Giter Site home page Giter Site logo

Comments (4)

landley avatar landley commented on August 14, 2024

There wasn't a switch_root in util-linux when I wrote https://git.busybox.net/busybox/commit/?id=0f34a821ab99 back in 2005 so "complete" sounds like a moving target here. I haven't looked at util-linux's source for license reasons and don't plan to start now. My patch to make CONFIG_DEVTMPFS_MOUNT apply to initramfs bounced (the reply to my third attempt was http://lkml.iu.edu/hypermail/linux/kernel/1709.1/04082.html at which point I lost interest) so when you start init in initramfs, you have no other filesystem mounted. You have to do all the mounts yourself before calling switch_root. If you put them in the old root filesystem instead of the new one, and didn't move them before calling switch_root... that's pilot error? Your script can call --move on the filesystems you added?

It's trivial to add this (an else case to the first if() in del_node) but... is there a reason to care that the third implementation of switch_root (after klibc and busybox) started adding random bells and whistles? There's no standard for this, my version was there first, and your init script did this to itself...?

Rob

from toybox.

 avatar commented on August 14, 2024

Hey Rob,

Thanks for your reply. I was not aware of your history with switch_root attempts, and I came at this only from the perspective of ‘Hey, this worked on until-linux, what gives?’

For now, my init is just handling the moves itself.

is there a reason to care that the third implementation of switch_root (after klibc and busybox) started adding random bells and whistles?

If it’s not a bell and whistle we care to add to toybox, we can close the issue. But surely the third iteration of switch root provided some advantages over the second.

I get that toybox is minimal, but I see no reason to reject a legitimate feature (if it is one) in the name of race to minimalism.

Finally, I’m obviously new to toybox. If there’s a guide to the standard of feature inclusion, I’d love to read it.

from toybox.

landley avatar landley commented on August 14, 2024

It's not a definite "no", it's a request for more information. Is there anything you can't do, or is this just a convenience? Did busybox and klibc already change to do what util-linux did? (if it's just util-linux, it'll be eaten by systemd in a couple years and disappear up into the big iron cloud space so not hugely relevant.)

It looks like busybox hasn't added this yet. they did add a "why switch_root" mailing list post I did a decade ago as a big comment though https://git.busybox.net/busybox/tree/util-linux/switch_root.c#n297

Unfortunately what to include or not in toybox isn't black and white, so I don't have a good summary. Instead I half a half-dozen things I could point you at to provide context. The most relevant of which is probably https://landley.net/toybox/roadmap.html .

A lot of other stuff is linked from https://landley.net/toybox/about.html (the design goals page is relevant, and the 2013 talk is still the best overview of what I'm trying to accomplish).

Other context is http://landley.net/aboriginal/about.html#design and below (the project's been replaced by https://github.com/landley/mkroot but the documentation's still relevant), and http://landley.net/aboriginal/history.html

from toybox.

 avatar commented on August 14, 2024

Thanks, this is all very useful information and very exciting.

Is there anything you can't do, or is this just a convenience?

No, it's just a convenience.

Did busybox and klibc already change to do what util-linux did

I'm not experienced enough in either project to go digging, so I'll defer to your judgement.

disappear up into the big iron cloud space

Lol 😄

I think we can close this. I'm fine with the workaround, and the comparable projects don't seem to care about the extra mounts either.

from toybox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.