我正在尝试创建一个新的 nv_uboot-snow-usb.kpart 文件,更改文件 Snow.h 文件上的一些参数,但我所做的修改不坚持

我正在尝试创建一个新的 nv_uboot-snow-usb.kpart 文件,更改文件 Snow.h 文件上的一些参数,但我所做的修改不坚持

我的 ARM Chromebook SNOW 的 mmc 插槽坏了,但我意识到我可以使用 USB 端口启动 Linux。为了能够通过 USB 启动 Linux,我修改了此文件:

https://github.com/virtualopensystems/u-boot/blob/eecfeb578e296ef3b739ac918a39b6c177dff58a/include/configs/snow.h#L101

这样 :

/*
 * Copyright (C) 2013 - Virtual Open Systems
 * Author: Nikolay Nikolaev <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef __configs_snow_h__
#define __configs_snow_h__

#include <configs/smdk5250.h>

#undef CONFIG_DEFAULT_DEVICE_TREE
#define CONFIG_DEFAULT_DEVICE_TREE      exynos5250-snow

/* Generally verified boot needs more heap space */
#undef CONFIG_SYS_MALLOC_LEN
#define CONFIG_SYS_MALLOC_LEN   (32 << 20)

#define CONFIG_INITRD_ADDRESS 0x44000000

#include <configs/chromeos.h>

/* Disable ChromeOS specifics */
#undef CONFIG_CHROMEOS

/* Force reading the environment */
#undef CONFIG_OF_LOAD_ENVIRONMENT

#define CONFIG_CHROMEOS_USB

/* Support vboot flag reading from GPIO hardwrae */
#define CONFIG_CHROMEOS_GPIO_FLAG

/* Support vboot flag reading from EC */
#define CONFIG_CHROMEOS_MKBP_FLAG

/* Use the default arch_phys_memset implementation */
#define CONFIG_PHYSMEM

/* Adjust the display resolution. */
#undef MAIN_VRESOL_VAL
#undef MAIN_HRESOL_VAL
#define MAIN_VRESOL_VAL 0x300
#define MAIN_HRESOL_VAL 0x556
#undef LCD_XRES
#undef LCD_YRES
#define LCD_XRES 1366
#define LCD_YRES 768
#define CONFIG_SYS_WHITE_ON_BLACK

/*
 * Extra bootargs used for direct booting, but not for vboot.
 * - console of the board
 * - debug and earlyprintk: easier to debug; they could be removed later
 */
#define CONFIG_DIRECT_BOOTARGS \
    "console=tty1 debug clk_ignore_unused"

/* Standard input, output and error device of U-Boot console. */
#define CONFIG_STD_DEVICES_SETTINGS     EXYNOS_DEVICE_SETTINGS

#define CONFIG_CHROMEOS_SD_TO_SPI \
    "sd_to_spi=echo Flashing U-Boot from SD card to SPI flash; " \
    "if mmc dev 1 && " \
    "mmc rescan && " \
    "mmc read 40008000 1 1000 && " \
    "sf probe 1:0 && " \
    "sf update 40008000 0 80000; then " \
    "echo Flash completed; else " \
    "echo Flash failed; " \
    "fi\0"

/* Replace default CONFIG_EXTRA_ENV_SETTINGS */
#ifdef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_EXTRA_ENV_SETTINGS
#endif
#define CONFIG_EXTRA_ENV_SETTINGS \
    EXYNOS_DEVICE_SETTINGS \
    "dtaddr=0x43000000\0"\
    "initrdaddr=0x44000000\0"\
    "boot_noinitrd=usb start ; usb dev 0 ; ext2load usb 0:2 ${loadaddr} uImage ; ext2load usb 0:2 ${dtaddr} exynos5250-snow.dtb ; bootm ${loadaddr} - ${dtaddr}\0"\
    "boot_initrd=usb start ; usb dev 0 ; ext2load usb 0:2 ${loadaddr} uImage ; ext2load usb 0:2 ${initrdaddr} initrd ; ext2load usb 0:2 ${dtaddr} exynos5250-snow.dtb ; bootm ${loadaddr} ${initrdaddr} ${dtaddr}\0"\
    "bootdelay=10\0"

#ifdef CONFIG_BOOTARGS
#undef CONFIG_BOOTARGS
#endif
#define CONFIG_BOOTARGS \
    "console=tty1 root=/dev/da0p4 rw rootwait clk_ignore_unused --no-log"

/* Replace default CONFIG_BOOTCOMMAND */
#ifdef CONFIG_BOOTCOMMAND
#undef CONFIG_BOOTCOMMAND
#endif
#define CONFIG_BOOTCOMMAND \
    "run boot_noinitrd"

/* Enable splash screens */
#define CONFIG_CROS_SPLASH

/* Enable simple framebuffer */
#define CONFIG_SIMPLEFB

/* Enable writing on a FAT formatted filesystem */
#define CONFIG_FAT_WRITE

/* Enable virt mode commands */
#define CONFIG_ARMV7_VIRT

/* Disable d-cache */
#define CONFIG_SYS_DCACHE_OFF

#endif /* __configs_snow_h__ */

我已经用 USB 0 修改了 mmc,并将超时从“bootdelay=3\0”更改为“bootdelay=10\0”,并且运行了位于此处的脚本:

https://github.com/virtualopensystems/u-boot/blob/eecfeb578e296ef3b739ac918a39b6c177dff58a/scripts/build.sh

这创建了一个新的:nv_uboot-snow-usb.kpart文件,我使用以下命令安装在安装了 Linux 的 SD 卡上:

# dd if=/dev/zero of=/dev/sdi1
dd: writing to '/dev/sdi1': No space left on device
32769+0 records in
32768+0 records out
16777216 bytes (17 MB, 16 MiB) copied, 2.07775 s, 8.1 MB/s

# sudo dd if=nv_uboot-snow-usb.kpart of=/dev/sdi1

此时,我将 USB 转 SD 卡转换器连接到 Chromebook 上,并尝试启动 Linux,但令我惊讶的是,我发现引导加载程序仍然设置为 3 秒。这意味着由于某种原因,新的nv_uboot-snow-usb.kpart没有被检测到,因为当我重新编译它时,我为u-boot选择了10秒的超时。我真的不知道为什么不应用新设置的原因......

相关内容