-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move root filesystem from rootfs to tmpfs #5133
Changes from all commits
edea8f9
a4c5992
ae8894c
eec1a06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
mkdir /sysroot | ||
# the value 90% borrowed from tcl via boot2docker | ||
mount -t tmpfs -o size=90% tmpfs /sysroot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment explaining how you arrived at 90% being the correct choice here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That’s easy, I stole it from tinycore (and boot2docker). 😀 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine. Just mention that you have copied the number from elsewhere then. I was afraid it might have some magical principle to it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll stick with 90%, until I know better. Will leave a reference to the original |
||
# copy from rootfs, to be able to do switch_root(8) | ||
tar -C / --exclude=sysroot -cf - . | tar -C /sysroot/ -xf - | ||
|
||
# devtmpfs does not get automounted for initramfs | ||
/bin/mount -t devtmpfs devtmpfs /sysroot/dev | ||
exec 0</sysroot/dev/console | ||
exec 1>/sysroot/dev/console | ||
exec 2>/sysroot/dev/console | ||
exec /sbin/switch_root /sysroot /sbin/init "$@" |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future archeologists, do you mind adding a quick comment describing why this file exists, and what it's intent is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
future archeologists hahaha ! love it ! hello future archeologists from 2019 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explaining init(1) ?
Or maybe what is the difference between this init and the normal one would be more appropriate. It doesn’t really help that the final
/sbin/init
is actually not init but just Lennart (systemd) posingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I for one didn't realize this took the place of the system init, though it makes sense given the location.
It'd be nice to have an explanation of why data is being copied from one directory to another before exec'ing out to another init. =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Settled for adding a reference to
switch_root(8)