[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#783074: flash-kernel: improvements to uboot-generic bootscript



On Tue, 2015-04-21 at 09:12 -0700, Vagrant Cascadian wrote:
> Package: flash-kernel
> Version: 3.35
> Severity: wishlist
> Tags: patch
> 
> This patch adds a few improvements to the uboot-generic bootscript:
> 
> * Use kernel version in versioned files
> * Include kernel version, device and partition in boot message
> * Set the console in bootargs
> * Set workaround for console value for some imx systems
> 
> The kernel versioning its also make it possible to use a kernel without
> relying on the various vmlinuz, initrd, dtb smlinks being valid, or for
> troubleshooting an alternate version.

What do you think about wrapping the load in a "for kver in -${kvers '';
do" and loading e.g. ${prefix}vmlinuz${kver}. IOW making it so that it
will try the suffixed version first but fallback to the symlinks if that
fails?

> 
> Including some or all of these could remove the need for several
> board-specific boot scripts, and possibly allow a reasonable default
> for unknown systems.
> 
> diff --git a/bootscript/bootscr.uboot-generic b/bootscript/bootscr.uboot-generic
> index 7451112..e68c306 100644
> --- a/bootscript/bootscr.uboot-generic
> +++ b/bootscript/bootscr.uboot-generic
> @@ -13,11 +13,21 @@
>  #
>  # The uboot must support the bootz and generic filesystem load commands.
>  
> +if test "${console}" = "ttymxc0" && test -n "${baudrate}"; then

The changelog says "some imx systems", do you have a list I could drop
in a comment or should I just say "#Workaround lack of console on
someIMX systems"?

> +  setenv console "${console},${baudrate}"
> +fi
> +
> +if test -n "${console}"; then
> +  setenv bootargs "${bootargs} console=${console}"
> +fi

I suppose hush doesn't have sufficient power to check for an existing
console= in bootargs?

My concern is that on devices with graphics capabilities it may be
tricky to avoid the above sending everything to the serial.

> +
>  setenv bootargs ${bootargs} @@LINUX_KERNEL_CMDLINE@@
>  @@UBOOT_ENV_EXTRA@@
>  
> -load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${prefix}vmlinuz \
> -&& load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${prefix}dtb \
> -&& load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} ${prefix}initrd.img \
> -&& echo "Booting Debian..." \
> +kvers='@@KERNEL_VERSION@@'
> +
> +load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${prefix}vmlinuz-${kvers} \
> +&& load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${prefix}dtb-${kvers} \
> +&& load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} ${prefix}initrd.img-${kvers} \
> +&& echo "Booting Debian ${kvers} from ${devtype} ${devnum}:${bootpart}..." \
>  && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
> 
> 
> live well,
>   vagrant


Reply to: