-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix booting from kernel for non-ubifs rootfs #41
base: 2015.10
Are you sure you want to change the base?
Conversation
Openwrt have squashfs rootfs but legacy and other variant uses ubifs rootfs. To make all compatible dont pass root= for kernel booting from kernel ubi volume. For others, pass root= to correctly identify rootfs filesystem. Signed-off-by: Abhimanyu Vishwakarma <[email protected]>
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.
I'll give it a test but could you confirm all the different scenarios that you have tested?
"ubi read $loadaddr kernel || reset;"\ | ||
"else "\ | ||
"echo Loading kernel from rootfs...;"\ | ||
"setenv bootargs $console $earlycon $ubimtd $nandroot $bootextra $mtdparts panic=2; && "\ |
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.
Having a semicolon changes the logic:
pistachio # true || echo foo
pistachio # true; || echo foo
foo
I don't think you want the && at all?
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.
if i dont pass && somehow bootargs was not getting pass correctly to kernel, we could remove ; though. any idea?
"ubifsmount ubi:rootfs && "\ | ||
"ubifsload $loadaddr $bootdir$fitfile || "NAND_BOOTCOMMAND_LEGACY"reset;"\ | ||
"ubifsload $loadaddr $bootdir$fitfile || "NAND_BOOTCOMMAND_LEGACY" "\ |
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.
Preferably would move the ||
out of NAND_BOOTCOMMAND_LEGACY to here rather than moving the reset
inside?
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.
The way i read is this:
Try ubifsload
if fail try nandboot
in nandboot
try booting (if success it will not return)
else if failed to boot reset
If ubifsload succeed proceed with booting or if case of failure reset.
So booting is something which is not expected to return if success. only in case it fails we want to reset. This is reason reset look more to be part with actually command for which we want to test the condition?
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.
The original idea was quite simple but we had to add legacy boot complications. Currently we attempted to follow this when loading kernel from the filesystem:
- try to load fit image from ubifs
- if fail try to load uImage from ubifs
- if fail reset
This means if we drop step 2 the device would still reset when step 1 fails.
* Openwrt have squashfs rootfs but legacy and other variant uses ubifs | ||
* rootfs. To make all compatible dont pass root= for kernel booting | ||
* from kernel ubi volume. For others, pass root= to correctly identify | ||
* rootfs filesystem. |
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.
This doesn't explain why this works, nor does the commit message. I would expect the commit message to go into detail of the different boot scenarios this supports.
"setenv legacy_nandroot ubi.mtd=firmware$boot_partition $legacy_nandroot;"\ | ||
"setenv bootargs $console $earlycon $legacy_nandroot $bootextra $mtdparts panic=2;"\ | ||
"echo Loading legacy kernel from rootfs... && "\ | ||
"echo Loading legacy kernel (uImage) from rootfs... && "\ |
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.
Technically it's still a variable so you can't specify uImage
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.
actually legacy bootfile is already uImage so it is always TRUE?
Openwrt have squashfs rootfs but legacy and other variant uses ubifs
rootfs. To make all compatible dont pass root= for kernel booting
from kernel ubi volume. For others, pass root= to correctly identify
rootfs filesystem.
Tested with legacy openwrt and new openwrt image.
Signed-off-by: Abhimanyu Vishwakarma [email protected]