-
-
Notifications
You must be signed in to change notification settings - Fork 208
Init changes #355
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
Init changes #355
Changes from all commits
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 |
|---|---|---|
|
|
@@ -470,9 +470,9 @@ CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y | |
| # CONFIG_BOOTCHARTD is not set | ||
| # CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set | ||
| # CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set | ||
| CONFIG_HALT=y | ||
| CONFIG_POWEROFF=y | ||
| CONFIG_REBOOT=y | ||
| # CONFIG_HALT is not set | ||
|
Collaborator
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. Why were these removed?
Collaborator
Author
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. These interfere with the sysrq-based scripts in bin on x230. I think those work always (as long as the kernel has it enabled). |
||
| # CONFIG_POWEROFF is not set | ||
| # CONFIG_REBOOT is not set | ||
| # CONFIG_FEATURE_CALL_TELINIT is not set | ||
| CONFIG_TELINIT_PATH="" | ||
| # CONFIG_INIT is not set | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/ash | ||
|
|
||
| # bring up the ethernet; maybe should do DHCP? | ||
| ifconfig lo 127.0.0.1 | ||
|
|
||
| if [ -f /lib/modules/e1000.ko ]; then | ||
| insmod /lib/modules/e1000.ko | ||
| fi | ||
|
|
||
| if [ -f /lib/modules/e1000e.ko ]; then | ||
| insmod /lib/modules/e1000e.ko | ||
| fi | ||
|
|
||
| if [ -e /sys/class/net/eth0 ]; then | ||
| # Setup static IP | ||
| if [ ! -z "$CONFIG_BOOT_STATIC_IP" ]; then | ||
| ifconfig eth0 $CONFIG_BOOT_STATIC_IP | ||
| fi | ||
| # TODO: setup DHCP if available | ||
| ifconfig eth0 > /dev/ttyprintk | ||
|
|
||
| # Setup the ssh server, allow root logins and log to stderr | ||
| if [ ! -d /etc/dropbear ]; then | ||
| mkdir /etc/dropbear | ||
| fi | ||
| dropbear -B -R 2>/dev/ttyprintk | ||
|
|
||
| ifconfig eth0 | head -1 > /dev/tty0 | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,22 +26,6 @@ if [ ! -r /dev/ptmx ]; then | |
| ln -s /dev/pts/ptmx /dev/ptmx | ||
| fi | ||
|
|
||
| # bring up the ethernet; maybe should do DHCP? | ||
| ifconfig lo 127.0.0.1 | ||
|
|
||
| if [ -f /lib/modules/e1000.ko ]; then | ||
| insmod /lib/modules/e1000.ko | ||
| ifconfig eth0 10.0.2.15 # qemu | ||
| ifconfig eth0 > /dev/ttyprintk | ||
|
|
||
| # Setup the ssh server, allow root logins and log to stderr | ||
| if [ ! -d /etc/dropbear ]; then | ||
| mkdir /etc/dropbear | ||
| fi | ||
| dropbear -B -R 2>/dev/ttyprintk | ||
| ifconfig eth0 | head -1 > /dev/tty0 | ||
| fi | ||
|
|
||
| # Recovery shells will erase anything from here | ||
| mkdir -p /tmp/secret | ||
|
|
||
|
|
@@ -67,11 +51,12 @@ if [ ! -z "$CONFIG_USB_BOOT_DEV" ]; then | |
| echo >> /etc/fstab "$CONFIG_USB_BOOT_DEV /media auto defaults,ro 0 0" | ||
| fi | ||
|
|
||
| if [ ! -x "$CONFIG_BOOTSCRIPT" ]; then | ||
| recovery 'Boot script missing? Entering recovery shell' | ||
| # just in case... | ||
| tpm extend -ix 4 -ic recovery | ||
| exec /bin/ash | ||
| # Setup recovery serial shell | ||
| if [ ! -z "$CONFIG_BOOT_RECOVERY_SERIAL" ]; then | ||
| stty -F "$CONFIG_BOOT_RECOVERY_SERIAL" 115200 | ||
| pause_recovery 'Console recovery shell' \ | ||
|
Collaborator
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. Does this require user intervension on every boot with
Collaborator
Author
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. Nope - you can boot normally via generic-init through the internal serial connected to the BMC. This is just here to enable recovery shell access on the external serial port on the back of the motherboard (in cases when the BMC is not active or down). This allows you to flash openbmc when physically local to the machine. You can also do this remotely if you configure network-init-recovery as the network bootscript (same drop to recovery shell on ssh into the machine) |
||
| < "$CONFIG_BOOT_RECOVERY_SERIAL" \ | ||
| > "$CONFIG_BOOT_RECOVERY_SERIAL" 2>&1 & | ||
| fi | ||
|
|
||
| # If the user has been holding down r, enter a recovery shell | ||
|
|
@@ -87,15 +72,37 @@ if [ "$boot_option" = "r" ]; then | |
| # Start an interactive shell | ||
| recovery 'User requested recovery shell' | ||
| # just in case... | ||
| tpm extend -ix 4 -ic recovery | ||
| if [ "$CONFIG_TPM" = y ]; then | ||
| tpm extend -ix 4 -ic recovery | ||
| fi | ||
| exec /bin/ash | ||
| exit | ||
| fi | ||
|
|
||
| echo '***** Normal boot:' $CONFIG_BOOTSCRIPT | ||
| exec "$CONFIG_BOOTSCRIPT" | ||
| if [ ! -x "$CONFIG_BOOTSCRIPT" -a ! -x "$CONFIG_BOOTSCRIPT_NETWORK" ]; then | ||
| recovery 'Boot script missing? Entering recovery shell' | ||
| else | ||
| if [ -x "$CONFIG_BOOTSCRIPT_NETWORK" ]; then | ||
| echo '***** Network Boot:' $CONFIG_BOOTSCRIPT_NETWORK | ||
| $CONFIG_BOOTSCRIPT_NETWORK | ||
| echo '***** Network Boot Completed:' $CONFIG_BOOTSCRIPT_NETWORK | ||
| # not blocking | ||
| fi | ||
|
|
||
| if [ -x "$CONFIG_BOOTSCRIPT" ]; then | ||
| echo '***** Normal boot:' $CONFIG_BOOTSCRIPT | ||
| exec "$CONFIG_BOOTSCRIPT" | ||
|
|
||
| # We should never reach here, but just in case... | ||
| recovery 'Boot script failure? Entering recovery shell' | ||
| else | ||
| # wait for boot via network to occur | ||
| pause_recovery 'Override network boot. Entering recovery shell' | ||
| fi | ||
| fi | ||
|
|
||
| # We should never reach here, but just in case... | ||
| recovery 'Boot script failure? Entering recovery shell' | ||
| # belts and suspenders, just in case... | ||
| tpm extend -ix 4 -ic recovery | ||
| if [ "$CONFIG_TPM" = y ]; then | ||
| tpm extend -ix 4 -ic recovery | ||
| fi | ||
| exec /bin/ash | ||
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 really should modify the x230-flash script to use flashtool. It is so much simpler than flashrom and takes up a fraction of the space.