Commit 5b629319cf58101b4d623017503d2437714e788a
Committed by
Tom Rini
1 parent
bb02c53660
Exists in
master
and in
53 other branches
common/cmd_bootm.c: fix subcommand processing in OS specific do_bootm_xxx() functions
In commit "5c427e4: use BOOTM_STATE_OS_CMDLINE flag for plain bootm" and "3d187b3: Only pass BOOTM_STATE_OS_CMDLINE on PowerPC/MIPS", BOOTM_STATE_OS_CMDLINE was added to do_bootm for PowerPC and MIPS. This breaks other OSes (vxworks, netbsd, plan9,...) that don't support subcommand processing, e.g. they all contain the following code in their do_bootm_xxx(): if (flag & BOOTM_STATE_OS_PREP) return 0; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; which will result a "subcommand not supported" error. This patch changes the above logic to: /* if not go command, pretend everything to be OK */ if (flag != BOOTM_STATE_OS_GO) return 0; Signed-off-by: Miao Yan <miao.yan@windriver.com>
Showing 1 changed file with 8 additions and 24 deletions Side-by-side Diff
common/cmd_bootm.c
| ... | ... | @@ -1469,10 +1469,8 @@ |
| 1469 | 1469 | char *consdev; |
| 1470 | 1470 | char *cmdline; |
| 1471 | 1471 | |
| 1472 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1472 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1473 | 1473 | return 0; |
| 1474 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1475 | - return 1; | |
| 1476 | 1474 | |
| 1477 | 1475 | #if defined(CONFIG_FIT) |
| 1478 | 1476 | if (!images->legacy_hdr_valid) { |
| 1479 | 1477 | |
| ... | ... | @@ -1550,10 +1548,8 @@ |
| 1550 | 1548 | { |
| 1551 | 1549 | image_header_t *hdr = &images->legacy_hdr_os_copy; |
| 1552 | 1550 | |
| 1553 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1551 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1554 | 1552 | return 0; |
| 1555 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1556 | - return 1; | |
| 1557 | 1553 | |
| 1558 | 1554 | #if defined(CONFIG_FIT) |
| 1559 | 1555 | if (!images->legacy_hdr_valid) { |
| 1560 | 1556 | |
| ... | ... | @@ -1574,10 +1570,8 @@ |
| 1574 | 1570 | { |
| 1575 | 1571 | void (*entry_point)(bd_t *); |
| 1576 | 1572 | |
| 1577 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1573 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1578 | 1574 | return 0; |
| 1579 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1580 | - return 1; | |
| 1581 | 1575 | |
| 1582 | 1576 | #if defined(CONFIG_FIT) |
| 1583 | 1577 | if (!images->legacy_hdr_valid) { |
| 1584 | 1578 | |
| ... | ... | @@ -1609,10 +1603,8 @@ |
| 1609 | 1603 | { |
| 1610 | 1604 | void (*entry_point)(void); |
| 1611 | 1605 | |
| 1612 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1606 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1613 | 1607 | return 0; |
| 1614 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1615 | - return 1; | |
| 1616 | 1608 | |
| 1617 | 1609 | #if defined(CONFIG_FIT) |
| 1618 | 1610 | if (!images->legacy_hdr_valid) { |
| 1619 | 1611 | |
| ... | ... | @@ -1645,10 +1637,8 @@ |
| 1645 | 1637 | void (*entry_point)(void); |
| 1646 | 1638 | char *s; |
| 1647 | 1639 | |
| 1648 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1640 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1649 | 1641 | return 0; |
| 1650 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1651 | - return 1; | |
| 1652 | 1642 | |
| 1653 | 1643 | #if defined(CONFIG_FIT) |
| 1654 | 1644 | if (!images->legacy_hdr_valid) { |
| 1655 | 1645 | |
| ... | ... | @@ -1694,10 +1684,8 @@ |
| 1694 | 1684 | { |
| 1695 | 1685 | char str[80]; |
| 1696 | 1686 | |
| 1697 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1687 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1698 | 1688 | return 0; |
| 1699 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1700 | - return 1; | |
| 1701 | 1689 | |
| 1702 | 1690 | #if defined(CONFIG_FIT) |
| 1703 | 1691 | if (!images->legacy_hdr_valid) { |
| 1704 | 1692 | |
| ... | ... | @@ -1719,10 +1707,8 @@ |
| 1719 | 1707 | char *local_args[2]; |
| 1720 | 1708 | char str[16]; |
| 1721 | 1709 | |
| 1722 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1710 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1723 | 1711 | return 0; |
| 1724 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1725 | - return 1; | |
| 1726 | 1712 | |
| 1727 | 1713 | #if defined(CONFIG_FIT) |
| 1728 | 1714 | if (!images->legacy_hdr_valid) { |
| 1729 | 1715 | |
| ... | ... | @@ -1746,10 +1732,8 @@ |
| 1746 | 1732 | { |
| 1747 | 1733 | void (*entry_point)(void); |
| 1748 | 1734 | |
| 1749 | - if (flag & BOOTM_STATE_OS_PREP) | |
| 1735 | + if (flag != BOOTM_STATE_OS_GO) | |
| 1750 | 1736 | return 0; |
| 1751 | - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) | |
| 1752 | - return 1; | |
| 1753 | 1737 | |
| 1754 | 1738 | #if defined(CONFIG_FIT) |
| 1755 | 1739 | if (!images->legacy_hdr_valid) { |