microsoft / microsoft/openvmm-deps
init checks for the root device as -f and it does not work because it is a block device
- Dominant language
- Shell
- Stars
- 15
- Forks
- 15
- Avg merge
- 1d 29m
- Merged PRs (30d)
- 7
Description
I can see my root fs as /dev/sda2, but when I submit it via cmdline in openvmm, the init does not recognize it, I think because the check should be -b and not -f:
```
if [ ! -f "$ROOT" ]; then
echo "Root device '$ROOT' does not exist. Dropping to a shell."
sh
fi
```
Log:
```
Root device '/dev/sda2' does not exist. Dropping to a shell.
sh: can't access tty; job control turned off
~ # ls -la /dev/sda*
brw------- 1 root root 8, 0 Jan 1 1970 /dev/sda
brw------- 1 root root 8, 1 Jan 1 1970 /dev/sda1
brw------- 1 root root 8, 2 Jan 1 1970 /dev/sda2
~ # [ ! -f "/dev/sda2" ]; echo $?
0
~ # [ ! -b "/dev/sda2" ]; echo $?
1
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the init script at the ROOT validation shown in the issue, focusing on how the root device is supplied from the openvmm command line. Reproduce with /dev/sda2 and confirm the check recognizes the block device instead of dropping to a shell. Done means valid root devices pass this check while missing devices still trigger the existing message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100