Reputation
791
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
3 9
Newest
 Editor
Impact
~25k people reached

  • 0 posts edited
  • 0 helpful flags
  • 44 votes cast
Nov
17
comment Host name changed remotely by wifi?
Yes, this is a bug, but one that people depending on it don't want fixed. :-(
Oct
11
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: Despite being frustrating, discussing this was productive in tracking down the issue. I've added an answer including notes on why I expected what I want to be possible, why it's not practical without modifying the kernel, and how the kernel could be trivially modified to support it.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
The kernel does not ignore it when an initramfs is appended, only when /init actually exists in the initramfs. Otherwise it tries to mount the root= device, mounts devtmpfs, and executes /sbin/init (or the init= command).
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: The distinction between "no initramfs" and "empty initramfs" is inconsequential. Either way, the kernel, not userspace, mounts the filesystem specified by root=. You can read this code in init/do_mounts.c. It most definitely happens in the kernel because there are no userspace programs in existence at this point.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: Are you ignoring everything I've said? In case (1) there is no initramfs. The kernel mounts the final (and only) root fs directly. My question is how to get an initramfs treated like a normal root.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: There are two scenarios I'm comparing whose behaviors differ: (1) no initrd image at all, root= processed by the kernel to directly mount the main filesystem, (2) exact same filesystem as in case 1, but linked into the kernel as an initramfs. I want to use exactly the same boot sequence for both, but the kernel insists on starting them differently because it thinks the latter is a temporary fs that will mount the real root fs later. I am asking if there's a way to inhibit this behavior and have the kernel treat both the same.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: My init executable most certainly does not handle root= because I wrote it. Please stop trying to answer this question with reasoning based on what your distro is doing. This question is about kernel behavior not typical initrd scripts' behaviors. The root= case I'm talking about is when no initrd whatsoever exists and the kernel does the mounting.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: That's false. With a normal root= root fs, devtmpfs is mounted by default by the kernel (CONFIG_DEVTMPFS_MOUNT) before any userspace processes execute, allowing /dev/console to be opened for the init process (by the kernel) without any hard device nodes existing anywhere, and the command specified by init= is executed as pid 1. This does not happen with initramfs. The difference in behavior is definitely on the kernel side and not in userspace. It's trivially testable with a fs consisting of a single static-linked program.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: The question is how to make an initramfs (linked into the kernel, but that doesn't matter to the question) get treated the way a normal root fs would get treated. If you want to say "Linux does not support that", that would be an answer. Claiming that it's already doing that is false and not helpful.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: You can observe all the behaviors I described with a trivial initramfs containing nothing but a static-linked program named init which lists the contents of /dev.
Oct
10
comment Is there a way to get Linux to treat an initramfs as the final root filesystem?
@mikeserv: Your comment is demonstrably false and does not address the question.
Sep
14
comment Why are all my SSH attempts failing due to timeout?
@Hut8: Is right. Of your 3 possibilities, only the third one (firewall) could possibly lead to timeouts.
Sep
10
comment How to copy a folder recursively in an idempotent way using cp?
With GNU tar, tar -C input -cf - . | tar -C output -xf - works. -C changes working directory, but it is not a standard option, so if it's not supported you need to run the two tars in the right working directories to begin with, e.g. ( cd input && tar -cf - . ) | ( cd output && tar -xf - ) However if you're dealing with Windows I would just use roaima's answer.
Sep
10
comment How to copy a folder recursively in an idempotent way using cp?
If you don't need to use cp, piping between two tar commands is a nice reliable way to copy trees.
Sep
3
comment Why does [A-Z] match lowercase letters in bash?
@schily: Do you have a citation for where changing the LC_* variables within a shell is required to cause it to update its own locale state? I would think exactly the opposite. In particular for a shell executing a script, changing locale mid-way through parsing/execution of the script would not even have well-defined behavior, as the script is a text file and "text file" is only meaningful within the context of a single character encoding.
Aug
25
comment Why pipe to cat only to redirect?
@IstvanChung: They're not equivalent. wc < file1 causes wc to run with stdin being a file descriptor for a regular seekable, mmappable file, file1. cat file1 | wc causes wc to run with a non-seekable pipe on stdin.
Jul
9
comment Why are UNIX/POSIX system call namings so illegible?
You might as well ask why they're not written in German, because that's about the closest natural-language approximation I can think of for the over-long monstrosities Java has taught programmers to accept...
Jun
8
comment Deleting files with spaces in their names
No need for xargs. Just use -exec rm -i '{}' +
May
12
comment Does bash open files in O_APPEND when using “>>” on linux?
In short, NFS is a load of bugs and should not be used.
Apr
7
comment What is the purpose of UEFI partition?
Why "unfortunately"? Does anyone actually want to use EFI to boot when there's an option not to?