Build a minimal Linux with only Busybox in 1 hour

Поділитися
Вставка
  • Опубліковано 15 вер 2024
  • In this video, we build a minimalistic Linux-System with only Busybox

КОМЕНТАРІ • 95

  • @niklasweber9869
    @niklasweber9869 2 роки тому +36

    I've been looking for this kind of tutorial for a long time. It is a key element for me in building my own embedded Linux. Turns out to be much simpler than expected. Thank you for the great video! Also your other videos are really insightful and help me to pull the strings together! I can't find any other videos like yours. Keep up the good work!

    • @cokeforever
      @cokeforever 2 роки тому +1

      you can, but there will be poor-english-speaker-hindu-native-presenter ;) and you can see that the hindu guy is making errors early on )) So yes, cheers on good video! I would only like you to tell us the final size of your busybox system? does it fit in 32MB?

  • @jailop7013
    @jailop7013 9 місяців тому +4

    Thanks so much. Fascinating. I followed your video step by step and got my mini-system running. You've openned for me a new door of knowlegde.

  • @BryanChance
    @BryanChance Рік тому +5

    This is really educational. I love your explanations. Thank you for sharing your work.

  • @lorensims4846
    @lorensims4846 10 місяців тому

    Awesome! Just a little toy box to play with.
    I've been looking for a minimal Linux build to work with. I even bought the smallest external hard drive I could find to mount it from. I first looked at Linux From Scratch, but they've gone all Systemd now and I really don't care for that.
    I've been looking into busybox for a long time and it's really improved over the years.
    It doesn't have EVERYTHING I want, but certainly most of it.
    Thank you so much for this!

  • @mousinahanger7621
    @mousinahanger7621 5 місяців тому +1

    For all the future visitors, the 'job control is, tty error' is actually distrubing. To fix it: run openvt -s -l -w /bin/sh or you can also run it with bash when bash is installed instead of direct /bin/sh. This allows you to run bash directly instead of busy box and it works! (Provided openvt is available from busy box so don't remove busybox)

  • @EduardoAvelar
    @EduardoAvelar 2 роки тому +4

    Amazing content!!
    Thanks for sharing your knowledge with us.
    By the way, you could do a series on how to build a very minimalistic distribution for Beagle Bone Black, Raspberry pi, or any SBC based on Allwinner or Media Teck for example.
    It would also be amazing.
    Thanks!

  • @subhankarkarmakar2650
    @subhankarkarmakar2650 2 роки тому +8

    I think you can do a :
    make -j$(nproc)
    and not hard-code 8 as some of us may have less than 8 processing units to work with, that $(nproc) will automatically substitute the max value or
    just use a variable to store the resulting value of $(nproc) and then substitute it.

  • @lopezd-rd7wm
    @lopezd-rd7wm Рік тому

    Excellent video Viktor. I've never seen someone been able to explain this so well.

  • @alaamo77
    @alaamo77 Рік тому

    Its really amazing. I was looking for a such training since long time. it's really detailed video and for first time i successfully build a small Linux box. thanks a lot for this great work.

  • @seadog-te1vj
    @seadog-te1vj 2 роки тому +1

    very cool. only no mention of how to set up a network card for the VM. 😀thanks for sharing.

  • @giveaway4002
    @giveaway4002 11 місяців тому +1

    this is so so so damm good. i learnt a lot, how everything works!

  • @joir2000
    @joir2000 Рік тому +1

    Very cool video.
    Works well over here too. Thanks!

  • @dmitryviktorovitch4915
    @dmitryviktorovitch4915 2 роки тому +9

    Hello. Can you bring a github with your files from that video or something kind of? It would be great.

  • @nbx2001
    @nbx2001 10 місяців тому +1

    Only a remark. The init-script look very static and it don't need to create via echo '...'. Also for the .config it is much simple to add a echo 'CONFIG_STATIC=Y' >>.config. But at all a great tutorial

  • @MrFranciss
    @MrFranciss 8 місяців тому

    Thank you very much, I've followed your tutorial and my initramfs works perfectly. I'll try to add some other stuff to it. Great tutorial!

  • @danielzalega8588
    @danielzalega8588 2 роки тому +4

    Misleading title. Should be 0.75 hour :D
    Cool video, thanks for recording.
    BTW, you can add "-e" to the shebang or "set -e" in any place to exit on error, making "|| exit" unneccessary.

    • @writeyourownoperatingsystem
      @writeyourownoperatingsystem  2 роки тому +6

      yeah, but when you count the fast-forwarded compile-time, it's about 1 hour :-D

    • @CodeNova
      @CodeNova 2 роки тому +3

      @@writeyourownoperatingsystem Great idea, they should add -ff flag to compiler :D

    • @jlxip
      @jlxip 2 роки тому +1

      Yep. "set -e" is a must in shell scripts to me. Kind of like "use strict"; in javascript.

  • @persimmon2298
    @persimmon2298 11 місяців тому +1

    Nice video. One minor note. In busybox build you can type "configure --enable-static" instead having to edit with sed. Perhaps this wasn't available when you made the video. I'm writing this in 2023.

  • @daniel_mg88
    @daniel_mg88 2 роки тому +2

    Very good video.
    Will the "Write your own Operating System" series ever continue?

  • @ChrisPinCornwall
    @ChrisPinCornwall 2 роки тому +1

    Ausgezeichnet! I really appreciate your videos, I'm learning a lot. Thank you.

  • @cyrusx6872
    @cyrusx6872 11 місяців тому

    Thank you for this wonderful informative and enlightening video!👍

  • @roddygonzalez8905
    @roddygonzalez8905 2 роки тому +2

    39:52 haha a classic one xD

  • @friskdreemurr8171
    @friskdreemurr8171 2 роки тому

    Der Mann the best teacher thank you man so much love and respect to you

  • @mbvj403
    @mbvj403 2 роки тому +2

    Hi! Could you please help me? When I compile busybox myself (downloading sources and compiling it exactly like in the video) I get kernel panic about no working init found. But when I download a precompiled busybox binary from their website, I get no errors. What could be the problem? I have Arch Linux too, and I've installed musl and kernel-headers-musl packages as well.
    upd: lol, I have finally realised what was the problem. I accidentally wrote "sed 's/^.*CONFIG_STATIC=.*$/CONFIG_STATIC=y/g' -i .config" in the script file, but in the default .config file CONFIG_STATIC line has no = sign, so my script didn't link libraries statically, and that was the problem of busybox was not working, so no working init was found.

  • @clinthsu7229
    @clinthsu7229 Рік тому

    Appreciate you share so detailed build process!

  • @mousinahanger7621
    @mousinahanger7621 4 місяці тому

    Thankyou very much. Good guide. I am still working on it. Now I can launch my GUI apps. My init proccess is still bash 😂. I don't use inird anymore. I found ways to directly mount things. Compiled kernel more than 50 times since the beginning. 😂

    • @liendatt8347
      @liendatt8347 3 місяці тому

      Hey, are you using a persistent storage instead of the ram disk? if so please tell me how I can do that.

  • @androth1502
    @androth1502 2 роки тому +3

    -compiles linux from source.
    -can't exit vi.
    :D

  • @fabiodefilippo9009
    @fabiodefilippo9009 7 місяців тому

    PERFECT, as always!

  • @okiforbreakfast
    @okiforbreakfast 8 місяців тому

    amazing video! thanks a lot!

  • @nightly_builds
    @nightly_builds 8 місяців тому

    "now i don't know how to exit it" :D great video

  • @joaogustavomatosmaranhao9160
    @joaogustavomatosmaranhao9160 2 роки тому

    Amazing! Greetings from Brazil!

  • @ragarwal74
    @ragarwal74 Рік тому

    Awesome! You are a super-hero!
    3 cheers!

  • @liendatt8347
    @liendatt8347 3 місяці тому

    I've done something similar before, although I didn't use busybox. I just wrote a simple c program, compiled it and linked it with static option. I added it to the ramfs and I instructed the kernel to use this program as entry. However the biggest problem that we should address here is about persistent file system. How to load drivers that can talk with the storage medium and tell the kernel to use this driver instead of the ramfs after booting of course. please let me know if someone knows how this is done.

  • @carlo_geiss
    @carlo_geiss Рік тому +1

    very nice ... thank you for tthe education ...do you have github ... with the tutorial in text ...???

  • @bmflinux
    @bmflinux 10 місяців тому

    Thanks! Amazing video. I'm looking for a way to put a simple linux terminal on some old Nintendo Wiis I have laying around the house. There are distros out for it but they use the old kernel (2.6). All I want to do is be able to ssh into my development server which has all the tools installed to begin with.

  • @gerhardroediger8331
    @gerhardroediger8331 3 місяці тому

    I don't get it. How does this boot without any form of bootloader? qemu does the "bootloading"?

  • @guzman-do
    @guzman-do Місяць тому

    Is it possible to add an also minimalistic GUI to this minimalistic Linux distro?

  • @dnkreative
    @dnkreative 9 місяців тому

    How different it'll be to crosscompile it for ARM base platform like Raspberry PI or its clone? I need a minimal system which can run SINGLE and the ONLY GUI app

  • @thelaggygamer5853
    @thelaggygamer5853 Рік тому

    This is very informational, could you make a video on how to get a very minimal de working. I would ask for hyperland or gtk(bspwm) setup but ik that would require a lot of files.

  • @therealchonk
    @therealchonk 2 роки тому

    Great to see you back again.
    I have watched your WYOOS series a few years ago.
    I have a couple of minor gripes:
    Instead of
    cd PATH
    ...
    cd ..
    better use:
    pushd PATH
    ...
    popd
    and make the shebang `#!/usr/bin/env bash` instead of `#!/bin/bash` therefore it's more portable.

    • @wilfridtaylor
      @wilfridtaylor 2 роки тому +7

      Don't do /usr/bin/env bash. That is mac nonsense. #!/bin/sh is the most portable because anything that can run posix scripts (including mac) can run it and its actually more portable.

  • @dingjunchen2912
    @dingjunchen2912 11 місяців тому

    I want to build Linux Kernel 2.4.36, which Busybox version should I use to build it?

  • @dingjunchen2912
    @dingjunchen2912 11 місяців тому

    Could you share the final script codes you completed in your video? I want to try it on my WSL under Windows to see if it works. Thanks indeed! I love your video very much.

  • @user-mp3wv2zy5n
    @user-mp3wv2zy5n Рік тому

    Thank you for making such a great video!!!
    Anyway, I was wondering if I can write a simple hello world C program, compile it (either in host or busybox environment), and execute it.

  • @TheDfgdfg345345
    @TheDfgdfg345345 Рік тому

    Hi, am I understand correctly that you run linux system with initrd as a root and usually "big" linux distributions do chroot ad the end of initrd?

  • @HK-sw3vi
    @HK-sw3vi Рік тому

    they this video is awesome. thanks for the content.

  • @arminmohammadi1
    @arminmohammadi1 7 місяців тому

    Hello, how to setup login for this small linux and run some python script after booting ?

  • @ChandrashekarCN
    @ChandrashekarCN 2 місяці тому

    💖💖💖💖

  • @lulledoom
    @lulledoom Рік тому

    Great but where are the kernel modules? or did you build also aa static kernel?

  • @azamaulana6075
    @azamaulana6075 Рік тому

    hella awesome content

  • @flatassembly
    @flatassembly 2 роки тому

    Good! Make more about these pls

  • @avocado9227
    @avocado9227 Рік тому

    Thanks. How then do you boot it on real hardware or generate a bootable ISO image?

  • @chrisWSR
    @chrisWSR Рік тому

    Excellent video, can be better, but when I finally finish and run the vm I got an error What does the error message "kernel panic - not syncing: No working init found" mean and how can I resolve it?

  • @RaveYoda
    @RaveYoda 2 роки тому

    Good stuff!!

  • @sanjaypj5808
    @sanjaypj5808 2 роки тому

    awesome content :) Thanks a lot

  • @junkmauler
    @junkmauler Рік тому

    Has anyone got this to work using kernel tinyconfig? I know there's things like config_tty, config_binfmt_elf, config_binfmt_script that will be needed, but my config just keeps asking me questions... want to make a very tiny kernel using a nice script like in this tutorial.

  • @xoxogamewolf7585
    @xoxogamewolf7585 27 днів тому

    How can I add a package manager?

  • @alexloktionoff6833
    @alexloktionoff6833 8 місяців тому

    Can you make a tutorial how to create minimalistic Linux on a 1.7 or 1.4 floppy?
    /*there are o such Linux-es any more :(*/

  • @kennethcarvalho3684
    @kennethcarvalho3684 Місяць тому

    Can we do in windows 10

  • @ThongThong
    @ThongThong 2 роки тому

    thank you so much sir.

  • @dickpiano1802
    @dickpiano1802 6 місяців тому +1

    great stuff. thank you so much.

  • @jlxip
    @jlxip 2 роки тому +4

    You could've used "cut" at 7:18, which is in coreutils. Something in the lines of $(echo $KERNEL_VERSION | cut -d'.' -f1)

  • @wsricardo23
    @wsricardo23 Рік тому

    Hi Sir,
    Please do you have text with your explanations and this script to study?
    Thank you very much.
    Regards.

  • @yap0916
    @yap0916 2 роки тому

    Can I do the same things to make a raspberry pi os?

  • @Turjak_art
    @Turjak_art Рік тому

    thank you runs

  • @CodeNova
    @CodeNova 2 роки тому

    Thank you for sharing this. What is memory and disk usage of this build ?

    • @Bruh-hd4rj
      @Bruh-hd4rj 2 роки тому

      I think approximatively 12Mb of disk usage

  • @poseidon3032
    @poseidon3032 2 роки тому

    I just want one for web browsing and watching videos (eliminate screen tearing). Once I achieve that, then I would be interested into increased functionality (build the window manager into such as Windows 9x) until I cross the use vs performance threshold for that system. Instead of building a general purpose OS, Multi-booting for singular functions may be a decent option as well.
    PSA: Watching your video would be easier if you had utilized Dark Mode.

  • @sajalkmr
    @sajalkmr 7 місяців тому

    Took some time as i was building on wsl

  • @Viken43
    @Viken43 2 роки тому

    Where can I find your scripts?

  • @GrindAlchemyTech
    @GrindAlchemyTech Рік тому

    🧑🏽‍💻🙌🏽🙏

  • @albertopajuelomontes2066
    @albertopajuelomontes2066 4 місяці тому

    cool, but if you want to use this on a real machine you also need a bootloader

  • @yap0916
    @yap0916 2 роки тому

    Can I install it on an usb and move from a computer to an other?

    • @mohamedsafy305
      @mohamedsafy305 2 роки тому

      Hey, did you find any answer for your question? because I]m also searching the same thing.

    • @yap0916
      @yap0916 2 роки тому

      @@mohamedsafy305 No

    • @kendricklamargaming8174
      @kendricklamargaming8174 Рік тому

      the approach I'd take here is to make a tar image of the system and copy it to the usb

  • @yap0916
    @yap0916 2 роки тому

    How can I install it on Hard Disk?

    • @komram4396
      @komram4396 11 місяців тому

      Long story short you will have to make a separate partition, make it bootable, install grub on it and write a simple config for grub to boot the kernel.

  • @hamicoshop
    @hamicoshop 2 роки тому

    Hi dear. Can you help me learn busybox operating systems . That installed on Chinese wifi camera? They called hip291 or goke

  • @yevgenzhuchij3555
    @yevgenzhuchij3555 2 роки тому

    You can use "Ctrl-A x" to terminate qemu

  • @hardwarelabor1631
    @hardwarelabor1631 2 роки тому

    Good Video but the version mess at the beginning was a bit unneccessary

  • @pewolo
    @pewolo Рік тому

    I don't know why people prefer minimalism with today super powerful machines.
    If I buy a PC, I want to use it to the fullest, that means using all the features the manufacturer says it has

    • @AnglerfishDeepcuts
      @AnglerfishDeepcuts Рік тому

      This is extreme minimalism, not really intended for a 'super powerful' PC. It's just a proof of concept for you get started with the topic. There are now boards half the size of a credit card that can run Linux pretty well, with onboard WiFi, HDMI, USB, camera, etc., powered by a small battery--but not packed with tons of ram and ssd space--so you trim some fat off the OS and your apps to get it running best.

  • @jermsbestfriend9296
    @jermsbestfriend9296 Рік тому

    Bro you need a mic and a dead air filter. The summary of this video is tiny font and a hot guy whispering to himself

  • @anupdhond
    @anupdhond Рік тому +1

    Nice vid, Howcome you are not using/building glibc for your linux system? For the record , you could substitute that complicated sed expression for fetching kernel version with :
    echo $KERNEL_VERSION | cut -d. -f1

  • @ABCABC-sw8mh
    @ABCABC-sw8mh 8 місяців тому +1

    why just all with the temp.sh script 🤐🤐🤐

  • @paulstaf
    @paulstaf 11 місяців тому

    Great tutorial, but one issue I noticed:
    line 46: You are in the bin folder and you are creating links using the version of busybox located in /bin/busybox and not the version you downloaded and compiled and just copied to the bin folder. The line should be:
    ln -s ./busybox ./$prog