Instalacja systemu z wykorzystaniem debootstrap

Wpis zamieszczony o 12:41:07, 16 czerwca 2007 Trackback


Nie tak dawno opisywałem sposób instalacji systemu operacyjnego przez sieć LAN. Rozwiązanie idealne dla systemów wbudowanych (Windows XP Embedded, DSL-emb etc.) oraz dla komputerów beznapędowych. W tamtym czasie nie zdawałem sobie sprawy z istnienia narzędzia, które dziś chcę Wam opisać.

Narzędziem tym jest debootstrap. Pozwala on na instalację systemu Debianowego z poziomu dowolnego Linuksa, bez udziału apt'a oraz dpkg. Potrafi pobrać ze zdalnych repozytoriów pakiety *.deb i rozpakować je do struktury FHS w dowolnym, podmontowanym katalogu systemu.

Co nam to daje? Możemy sobie przetestować w bezpiecznym, chrootowanym środowisku na Ubuntu, czy bylibyśmy sobie w stanie poradzić z Debianem ;-). Można też pomęczyć system, popatrzeć jak działa bez strachu o swoje dane. W zasadzie - otrzymujemy zagnieżdzony, wirtualny system w systemie, którego nie ograniczają sztywne ramy emulacji rodem od VMware czy VirtualBox. Środowisko, w którym nie boimy się działać i uczyć się nowych rzeczy.
"Hej, a co się stanie jak usunę /etc/fstab?!" - teraz możesz to sprawdzić!

A zatem:

1. instalacja

Banalnie prosta:
# apt-get install debootstrap

2. konfiguracja

Zerowa :-))

3. instalacja systemu

Spójrzmy najpierw do /usr/lib/debootstrap/scripts, znajdziemy tam predefinowane systemu, które możemy instalować z wykorzystaniem debootstrap. U mnie są to:

-rw-r--r-- 1 root root 5433 2007-04-10 21:28 breezy
lrwxrwxrwx 1 root root    3 2007-06-13 15:35 etch -> sid
-rw-r--r-- 1 root root 7828 2007-04-10 21:28 hoary
-rw-r--r-- 1 root root 5774 2007-04-10 21:28 hoary.buildd
lrwxrwxrwx 1 root root    3 2007-06-13 15:35 lenny -> sid
-rw-r--r-- 1 root root 3408 2007-04-10 21:28 potato
-rw-r--r-- 1 root root 8387 2007-04-10 21:28 sarge
-rw-r--r-- 1 root root 5672 2007-04-10 21:28 sarge.buildd
-rw-r--r-- 1 root root 5902 2007-04-10 21:28 sarge.fakechroot
-rw-r--r-- 1 root root 5685 2007-04-10 21:28 sid
-rw-r--r-- 1 root root 7390 2007-04-10 21:28 warty
-rw-r--r-- 1 root root 5656 2007-04-10 21:28 warty.buildd
-rw-r--r-- 1 root root 7722 2007-04-10 21:28 woody
-rw-r--r-- 1 root root 5709 2007-04-10 21:28 woody.buildd

Mogę zatem instalować wszystkie wersje Debiana oraz starsze wersje Ubuntu (które niestety już nie leżą na serwerach). Nie wiem, jak sytuacja ma się w Ubuntu - zawsze jednak można poszukać nowym buildów bądź też samemu stworzyć jakiś (w tym momencie pracuję nad minimalnym obrazem instalacyjnym najnowszego Ubuntu). Jak zatem tego użyć?
Wpisujemy:
# mkdir /home/sarge - tworzymy katalog instalacji
# debootstrap sarge /home/sarge http://ftp.debian.org/debian/ - instalujemy Sarge'a
# echo "proc /home/sarge/proc proc none 0 0" >> /etc/fstab - montujemy proc
# mount proc /home/sarge/proc -t proc
Została nam jeszcze konfiguracja sieci:
# cp /etc/hosts /home/sarge/etc/hosts
# echo "8:23:respawn:/usr/sbin/chroot /home/sarge /sbin/getty 38400 tty8" >> /etc/inittab - zadziała tylko na Debianie i starszych Ubuntu!
# init q
Jeśli posiadamy system, który nadal korzysta z systemV-init a nie upstart'a, na konsoli tty8 zobaczymy konsolę logowania naszego nowego systemu ;-).
Jeśli zaś posiadamy system, który posiada upstart, musimy chrootować się do nowego środowiska:
# chroot /home/sarge /bin/bash
I w zasadzie to wszystko. Musimy pamiętać, że otrzymujemy czysty, totalnie okrojony system. Bez locales, bez jądra, bez skonfigurowanych repozytoriów. Praktycznie o każdy element systemu musimy zadbać sami.
Dodatkowo odsyłam do:
$ man debootstrap
Materiału o instalacji Debiana z Knoppixa
Tworzeniu VM z Debianem na pokładzie

Zatem - powodzenia!

Komentarze do “Instalacja systemu z wykorzystaniem debootstrap”


  1. napisz jeszcze drugi kurs - co jest konieczne do instalacji, jakie potrzebujemy pakiety zeby system wystartowal i konfiguracja grubaska ;)


  2. Hmm, to nie jest głupi pomysł :-) Szczególnie że cały dzisiejszy dzień mam totalnie wolny.

    Jestem fanem lilo (tak wiem, bez komentarza ;P), więc dam 2 rozwiązania - lilo und GRUB.

    Sądzę, że za 4-5 godzin art będzie wisiał.


  3. > 1. instalacja
    >
    > Banalnie prosta:
    > # apt-get install debootstrap

    To bardzo miło, że Debiana można zainstalować spod... hmm... Debiana. Szkoda że nie podałeś procedury instalacji pod innymi dystrybucjami, bo pod takim Slackware to było nietrywialne zadanie (głównie ze względu na debianowy pomysł na sposób tworzenia tarballi z plikami urządzeń).


  4. O, dozzie... Miło Ciebie tutaj widzieć :-).

    Powiem szczerze - niespecjalnie znam Slacka. Używałem do tej pory RH, Fedory, Gentoo, Debka, Ubuntu oraz Mandrake (starego). Prawdę powiedziawszy, musiałbym opisać uniwersalny sposób instalacji z tar.gz, jednak jak wiesz to by zaimplikowało kolejne problemy pod różnymi distrami.

    A co do tworzenia struktury /dev (bo o tym mówisz?) w Debianie:
    # cd /dev; ./MAKEDEV
    Chyba że chodziło Tobie o udev'a.


  5. Owszem, o MAKEDEV chodziło. Slackware'owy sobie nie radzi z debianowym pomysłem na niektóre nazwy urządzeń, już nie pamiętam szczegółów. Musiałem przygotować tarballe z plikami urządzeń pod Debianem, żeby móc zainstalować (tj. przygotować pakiet) debootstrapa na Slacku.


  6. Ciekawostka zacna! ;-)

    Zaintrygowałeś mnie do tego stopnia, że w najbliższym czasie postawię slacka na jakimś starym blaszaku i się kilka tygodni pobawię.

    Nie wiedziałem, że nazwy urządzeń w /dev nie są zunifikowane (są różne pod różnymi distrami).

    Czas poznać nowe ;-)

    Pozdrawiam!


  7. Debootstrap ma tez AFAIR wersje RPMowa


  8. Czyli jednak ci cos nie pasuje, skoro narzekasz. Mozesz zostac, ale siedz cicho i wyjdz po angielsku.


  9. Debootstrap:
    Debian: http://packages.debian.org/stable/admin/debootstrap
    Ubuntu: http://packages.ubuntu.com/feisty/admin/debootstrap
    RPM (very old :( ): http://www.pcwelt.de/downloads/linux/linux/118827/
    I co zrobić pod nie_debianowym systemem:
    http://www.jwhitham.org.uk/debootstrap.html

    Pozdro :-)


  10. I jeszcze co do instalacji Debiana pod Debianem:
    Niekoniecznie tak jest. Wrzucasz płytkę bootowalną Knoppixa (lub Ubuntu), instalujesz debootstrap w sposób który podałem, montujesz zasób, kopiujesz, chroot, instalacja jajka, GRUB. Odmontowanie.

    I nawet nie ruszyłeś swojego Slack//Gentoo//RH z dysku. Ba! Nawet go nie zaśmieciłeś.


  11. Polecam użycie debootstrap razem z fakechroot. Robi cuda, tzn pozwala na zainstalowanie systemu w katalogu użytkownika bez użycia uprawnień roota w ogóle.


  12. A nie lepiej http://wubi-installer.org/ ?
    (Instalator ubuntu pod windows)


  13. ZET, nei wszyscy maja winde


  14. Witam.
    Sam niedawno odkryłem to narzędzie przy okazji poznawania xen (np.: http://www.artinfo.com.pl/baza-wiedzy/linux%11system/xen-vm-debian-etch-instalacja/) . Dla mnie po prostu bajka. Właśnie przygotowuje serwer na którym będę mógł testować lenny/sid/... instalowanego z debootstrap odpalanego na etch-u. I tak na stabilnym serwerze produkcyjnym będę mógł tworzyć środowiska testowe używanych aplikacji na nowych wersjach sys. op. bez zakwaszania aplikacji w wersjach produkcyjnych. Bajka.


  15. Witam,
    Jest możliwość przy pomocy debootstrap zainstalować 64 bitową wersję systemu spod 32 bitowego debiana?


  16. God how I hate RPM based distros, let me count the ways. I've heard FC is suesppod to have something called yum that works like apt, however if it's anything like up2date it's still a pile of crap. Does it still suffer from the infamous recursive requirements problem? I remember my own personal hell of installing E (0.14!!!) back in the day and each new RPM I tried to install resulted in another 10 RPM's that the first RPM depended on.Mmmmm . apt-get. Recursively finds packages and installs everything you need. Sorry, all of these Debian posts are making me want to run Debian on my PowerBook (Ha! Crazy thoughts since fink allows me to install and use apt-get on my PowerBook, which, btw, kicks total ass).


  17. Hello there, just became alert to your blog through Google, and found
    that it's truly informative. I'm going to watch out for brussels.
    I'll be grateful if you continue this in future. A lot of people
    will be benefited from your writing. Cheers!


  18. You actually make it appear so easy together with your presentation however I find this matter to be actually one thing that I feel I might
    never understand. It kind of feels too complex and extremely extensive for me.

    I am looking ahead to your subsequent post, I will try to get
    the dangle of it!


  19. Excellent post. I used to be checking constantly this blog and I'm inspired!

    Extremely useful information specifically the closing section :)
    I handle such information a lot. I was seeking this particular info for a long
    time. Thank you and best of luck.


  20. Hi there I am so happy I found your webpage, I really found you by mistake, while I was looking on Bing for something
    else, Nonetheless I am here now and would just like to say cheers for a marvelous post and a
    all round enjoyable blog (I also love the theme/design), I don't have time
    to read through it all at the moment but I have saved it and also added in your RSS
    feeds, so when I have time I will be back to read more, Please do keep up the excellent job.


  21. I constantly spent my half an hour to read this website's
    content daily along with a cup of coffee.


  22. It's very simple to find out any matter on web as compared to
    books, as I found this article at this website.


  23. Hello there! Quick question that's entirely off topic.
    Do you know how to make your site mobile friendly?
    My weblog looks weird when viewing from my apple iphone.
    I'm trying to find a theme or plugin that might be able to resolve
    this problem. If you have any suggestions, please share. Cheers!


  24. Attractive section of content. I just stumbled upon your blog and in accession capital to assert that I acquire in fact enjoyed account
    your blog posts. Anyway I will be subscribing to your feeds
    and even I achievement you access consistently quickly.


  25. John Wild is vice president of Absolute
    Access & Security. • Don’t forget to check its compatibility
    with your building structure and the ability of the system to deliver
    a good sound quality which depends on the
    structure of your home. Are you looking for an effective way to protect
    your family and your home.


  26. Do you might have a steady income but they are strapped for cash at
    the moment.


  27. Good day! This is my first visit to your blog! We are a team of volunteers and starting a new initiative
    in a community in the same niche. Your blog provided us valuable information to work on.
    You have done a marvellous job!


  28. Hello to every body, it's my first visit of this website; this blog contains remarkable and actually excellent material for readers.


  29. What many state attorneys general have deemed veiled loan sharking, these financing options often trap vulnerable borrowers into
    high-interest, high-fee loans that customers have little hope of
    repaying. They also generally require ID, proof your car is
    insured, and proof regular income such being a paycheck stub or
    copy of any retirement check.


  30. you are truly a just right webmaster. The website loading velocity is amazing.
    It kind of feels that you're doing any distinctive trick.
    In addition, The contents are masterwork. you have done a excellent task
    on this subject!


  31. Hmm is anyone else having problems with the images on this blog loading?
    I'm trying to find out if its a problem on my end or if it's the blog.
    Any feed-back would be greatly appreciated.


  32. Hello to all, how is the whole thing, I think every one is getting more from this website, and your views are nice in support of
    new visitors.


  33. I every time spent my half an hour to read this web site's posts every day along with a mug of coffee.


  34. Very good info. Lucky me I ran across your website by
    accident (stumbleupon). I've book marked it for later!


  35. Your style is really unique in comparison to other
    people I've read stuff from. Thank you for posting when you have the opportunity, Guess I will
    just bookmark this site.


  36. If a website isn't secure, do not create a purchase.


  37. An ectopic pregnancy is when a fertilized egg implants itself inside the fallopian tubes (tubal pregnancy) instead of the
    uterus.


  38. You usually do not want to get stuck with purchases made on the card in the event the
    number is stolen.


  39. I really like reading an article that will make men and women think.
    Also, thanks for allowing for me to comment!


  40. My family members always say that I am killing my time here
    at net, except I know I am getting know-how all
    the time by reading thes pleasant posts.


  41. It's really a cool and useful piece of information. I'm
    glad that you shared this helpful information with us. Please stay us up to date
    like this. Thanks for sharing.


  42. Wow that was unusual. I just wrote an very long comment but after
    I clicked submit my comment didn't appear. Grrrr...
    well I'm not writing all that over again. Anyways, just wanted to say wonderful blog!


  43. When you buy online, you may need to get the best price.


  44. Hello there! This post could not be written any better! Reading
    through this post reminds me of my old room mate!
    He always kept talking about this. I will forward this article to him.
    Pretty sure he will have a good read. Thank you for sharing!


  45. Though it's hard at first, try not eating 3 hours or more before bedtime.

    Over the coming weeks gradually reduce the time you spend online and eventually you'll have a
    healthier lifestyle. One other thing to bear in mind is that if you can do the
    kind of chore that requires depth and repetition, then it'll supply a greater workout.


  46. Good post. I am going through many of these issues as well..


  47. I've been surfing online more than 2 hours today, yet
    I never found any interesting article like yours.
    It's pretty worth enough for me. Personally, if all website owners and bloggers made
    good content as you did, the internet will be much more useful than ever before.


  48. Hi there! I could have sworn I've visited this site before but after looking at some
    of the posts I realized it's new to me. Anyhow,
    I'm definitely delighted I discovered it and I'll be bookmarking it and checking
    back frequently!


  49. Try to aim for around six hours of sleep so that you'll be able to be about
    the ball in school and using your social life.


  50. I've learn several excellent stuff here. Certainly value
    bookmarking for revisiting. I wonder how much effort you put to make the sort of
    fantastic informative website.


  51. Hello, i think that i saw you visited my web site so i came
    to return the desire?.I am trying to in finding things to improve my
    site!I guess its good enough to use a few of your ideas!!


  52. Greetings! Very helpful advice within this post!

    It's the little changes that will make the most significant changes.
    Thanks a lot for sharing!


  53. hi!,I love your writing so much! share we be in contact extra about your post on AOL?
    I require an expert in this space to solve my problem.
    May be that is you! Having a look forward to peer you.


  54. Howdy very cool site!! Guy .. Beautiful .. Amazing
    .. I will bookmark your website and take the feeds also?
    I am glad to search out numerous useful information here in the submit, we want work out
    more techniques on this regard, thanks for sharing. . . .
    . .


  55. I'm impressed, I must say. Seldom do I come across a blog
    that's both equally educative and amusing, and without a doubt, you have hit the nail on the head.
    The problem is something too few folks are speaking intelligently about.
    I am very happy I found this in my hunt for something concerning this.


  56. This is my first time visit at here and i am really impressed to read everthing at
    single place.


  57. Hello to all, the contents present at this web page are really awesome for people experience, well, keep up the good
    work fellows.


  58. It's perfect time to make a few plans for the long run and it is time to be happy.

    I've read this submit and if I may just I wish to suggest you some attention-grabbing
    issues or tips. Maybe you could write subsequent articles relating to
    this article. I wish to learn more issues approximately it!


  59. Good post. I learn something totally new and challenging on websites I stumbleupon on a daily
    basis. It's always interesting to read through content from other writers
    and use a little something from other sites.


  60. I'll right away take hold of your rss feed as I can't in finding your email subscription hyperlink or newsletter service.
    Do you've any? Please let me understand so that I may subscribe.
    Thanks.


  61. Now I am going away to do my breakfast, when having my breakfast coming over again to read
    more news.


  62. However, the earlier you acquire quotes from area Kansas network cabling specialists, the much better as well as smoother
    that puzzle will certainly fit together for you.


  63. I every time used to read article in news papers but now as I am a
    user of internet so from now I am using net for content, thanks to web.


  64. Hey There. I discovered your blog using msn. This is an extremely neatly written article.
    I'll make sure to bookmark it and return to learn more of your helpful information. Thank you for
    the post. I will definitely return.


  65. Attractive section of content. I just stumbled upon your web site and in accession capital to assert that I
    get in fact enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently rapidly.


  66. Article writing is also a fun, if you be acquainted with
    afterward you can write or else it is difficult to write.


  67. Useful information. Fortunate me I found your web site unintentionally, and I'm shocked why this accident didn't happened in advance!
    I bookmarked it.


  68. Awesome blog! Do you have any recommendations for aspiring writers?
    I'm hoping to start my own site soon but I'm a little lost
    on everything. Would you propose starting with a free platform like Wordpress or go for
    a paid option? There are so many options out there that I'm
    completely confused .. Any tips? Thanks a lot!


  69. Write more, thats all I have to say. Literally,
    it seems as though you relied on the video to make your point.
    You clearly know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be
    giving us something enlightening to read?


  70. STOP living just like a 21st century caveman and plug into
    these clever methods to get who you are a smarter home
    where fridges speak with us and robots do all the dirty work.
    After filling out your form, several weeks passed, as well as the Hotmail account holder
    said she has still received no further response from Microsoft.

Dodaj komentarz

Textile jest włączony. Zobacz składnię (wiki.jogger.pl)

code