distro_defaults: do all the searching in boot.scr, less u-boot patching for distro_defaults enabled boards

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/37/head
Robert Nelson 10 years ago
parent cf456d9251
commit 27cdab4c87

@ -20,6 +20,7 @@ boot_name="u-boot.sunxi"
#Bootloader: u-boot features:
conf_config_distro_defaults="enable"
conf_smart_uboot="enable"
#Kernel:
#https://rcn-ee.net/deb/wheezy-armhf/LATEST-armv7

@ -20,6 +20,7 @@ boot_name="u-boot.sunxi"
#Bootloader: u-boot features:
conf_config_distro_defaults="enable"
conf_smart_uboot="enable"
#Kernel:
#https://rcn-ee.net/deb/wheezy-armhf/LATEST-armv7

@ -149,6 +149,7 @@ else
fi
fi
echo "set_boot_args=setenv bootargs console=\${console} \${optargs} \${cape_disable} \${cape_enable} root=\${root} rootfstype=\${rootfstype} \${cmdline}" >> ${wfile}
echo "uuid=$(/sbin/blkid -c /dev/null -s UUID -o value ${FINAL_PART})" >> ${wfile}
echo "root=${FINAL_PART} ro" >> ${wfile}
echo "rootfstype=${FINAL_FSTYPE} fixrtc" >> ${wfile}

@ -1,4 +1,96 @@
echo "distro_defaults: boot.scr/uEnv.txt wrapper..."
load ${devtype} ${devnum}:${bootpart} ${scriptaddr} /boot/uEnv.txt
env import -t ${scriptaddr} ${filesize}
run uenvcmd
echo ; echo Searching for: /boot/uEnv.txt ...;
for i in 1 2 3 4 5 6 7 ; do
setenv bootpart ${i};
echo Trying: ${devtype} ${devnum}:${bootpart} ...;
if test -e ${devtype} ${devnum}:${bootpart} /boot/uEnv.txt; then
echo Found: /boot/uEnv.txt on [${devtype} ${devnum}:${bootpart}] ...;
load ${devtype} ${devnum}:${bootpart} ${scriptaddr} /boot/uEnv.txt
env import -t ${scriptaddr} ${filesize}
if test -n ${dtb}; then
setenv fdtfile ${dtb};
echo Using: [dtb=${fdtfile}] ...;
fi;
if test -n ${uname_r}; then
echo Using: [uname_r=${uname_r}] ...;
fi;
if test -n ${uuid}; then
echo Using: [uuid=${uuid}] ...;
else
echo Warning: [uuid] is not set in /boot/uEnv.txt ...;
echo Using: [root=${mmcroot} ro] ...;
fi;
if test -n ${uname_r}; then
setenv bootdir /boot;
setenv bootfile vmlinuz-${uname_r};
echo ; echo Searching for: Linux Kernel [vmlinuz-${uname_r}] ...;
echo Trying: ${bootdir}/${bootfile} ...;
if test -e ${devtype} ${devnum}:${bootpart} ${bootdir}/${bootfile}; then
echo Found: ${bootdir}/${bootfile} ...;
load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} ${bootdir}/${bootfile}
echo ; echo Searching for: Device Tree Blob [${fdtfile}] ...;
setenv fdtdir /boot/dtbs/${uname_r};
echo Trying: ${fdtdir}/${fdtfile} ...;
if test -e ${devtype} ${devnum}:${bootpart} ${fdtdir}/${fdtfile}; then
echo Found: ${fdtdir}/${fdtfile} ...;
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${fdtdir}/${fdtfile}
else
setenv fdtdir /usr/lib/linux-image-${uname_r};
echo Trying: ${fdtdir}/${fdtfile} ...;
if test -e ${devtype} ${devnum}:${bootpart} ${fdtdir}/${fdtfile}; then
echo Found: ${fdtdir}/${fdtfile} ...;
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${fdtdir}/${fdtfile}
else
setenv fdtdir /lib/firmware/${uname_r}/device-tree;
echo Trying: ${fdtdir}/${fdtfile} ...;
if test -e ${devtype} ${devnum}:${bootpart} ${fdtdir}/${fdtfile}; then
echo Found: ${fdtdir}/${fdtfile} ...;
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${fdtdir}/${fdtfile}
else
setenv fdtdir /boot/dtb-${uname_r};
echo Trying: ${fdtdir}/${fdtfile} ...;
if test -e ${devtype} ${devnum}:${bootpart} ${fdtdir}/${fdtfile}; then
echo Found: ${fdtdir}/${fdtfile} ...;
load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} ${fdtdir}/${fdtfile}
fi
fi;
fi;
fi;
setenv rdfile initrd.img-${uname_r};
echo ; echo Searching for: Linux initial RAM disk [initrd.img-${uname_r}] ...;
echo Trying: ${bootdir}/${rdfile} ...;
if test -e ${devtype} ${devnum}:${bootpart} ${bootdir}/${rdfile}; then
echo Found: ${bootdir}/${rdfile} ...;
load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} ${bootdir}/${rdfile}; setenv initrd_size ${filesize}
if test -n ${uuid}; then
setenv root UUID=${uuid} ro;
fi;
if test -n ${mmcargs}; then
run mmcargs;
fi;
if test -n ${set_boot_args}; then
run set_boot_args;
fi;
echo debug: [${bootargs}] ... ;
echo debug: [bootz ${kernel_addr_r} ${ramdisk_addr_r}:${initrd_size} ${fdt_addr_r}] ... ;
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${initrd_size} ${fdt_addr_r}
else
echo Not using Linux initial RAM disk: [initrd.img-${uname_r}] ...;
if test -n ${mmcargs}; then
run mmcargs;
fi;
if test -n ${set_boot_args}; then
run set_boot_args;
fi;
echo debug: [${bootargs}] ... ;
echo debug: [bootz ${kernel_addr_r} - ${fdt_addr_r}] ... ;
bootz ${kernel_addr_r} - ${fdt_addr_r}
fi;
fi;
fi;
fi;
done;

@ -119,6 +119,7 @@ else
fi
fi
echo "set_boot_args=setenv bootargs console=\${console} \${optargs} \${cape_disable} \${cape_enable} root=\${root} rootfstype=\${rootfstype} \${cmdline}" >> ${wfile}
echo "uuid=$(/sbin/blkid -c /dev/null -s UUID -o value ${FINAL_PART})" >> ${wfile}
echo "root=${FINAL_PART} ro" >> ${wfile}
echo "rootfstype=${FINAL_FSTYPE} fixrtc" >> ${wfile}

@ -304,62 +304,6 @@ boot_uenv_txt_template () {
xyz_message="echo; echo Installer for [${DISTARCH}] is using the Video Interface; echo Use [--serial-mode] to force Installing over the Serial Interface; echo;"
fi
if [ "x${conf_config_distro_defaults}" = "xenable" ] ; then
cat >> ${TEMPDIR}/bootscripts/normal.cmd <<-__EOF__
fdtfile=${dtb}
##Video: [ls /sys/class/drm/]
##Docs: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/fb/modedb.txt
##Uncomment to override:
#kms_force_mode=video=${drm_device_identifier}:1024x768@60e
console=SERIAL_CONSOLE
mmcroot=FINAL_PART ro
mmcrootfstype=FINAL_FSTYPE rootwait fixrtc
loadximage=load \${devtype} \${devnum}:\${bootpart} \${kernel_addr_r} ${kernel}
loadxfdt=load \${devtype} \${devnum}:\${bootpart} \${fdt_addr_r} /boot/dtbs/current/\${fdtfile}
loadxrd=load \${devtype} \${devnum}:\${bootpart} \${ramdisk_addr_r} ${initrd}; setenv initrd_size \${filesize}
loadall=run loadximage; run loadxfdt; run loadxrd;
optargs=VIDEO_CONSOLE
mmcargs=setenv bootargs console=\${console} \${optargs} \${kms_force_mode} root=\${mmcroot} rootfstype=\${mmcrootfstype}
uenvcmd=run loadall; run mmcargs; bootz \${kernel_addr_r} \${ramdisk_addr_r}:\${initrd_size} \${fdt_addr_r}
__EOF__
cat >> ${TEMPDIR}/bootscripts/netinstall.cmd <<-__EOF__
fdtfile=${dtb}
##Video: [ls /sys/class/drm/]
##Docs: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/fb/modedb.txt
##Uncomment to override:
#kms_force_mode=video=${drm_device_identifier}:1024x768@60e
console=DICONSOLE
mmcroot=/dev/ram0 rw
loadximage=load \${devtype} \${devnum}:\${bootpart} \${kernel_addr_r} ${kernel}
loadxfdt=load \${devtype} \${devnum}:\${bootpart} \${fdt_addr_r} /boot/dtbs/current/\${fdtfile}
loadxrd=load \${devtype} \${devnum}:\${bootpart} \${ramdisk_addr_r} ${initrd}; setenv initrd_size \${filesize}
loadall=run loadximage; run loadxfdt; run loadxrd;
xyz_message=${xyz_message}
optargs=${conf_optargs}
mmcargs=setenv bootargs console=\${console} \${optargs} \${kms_force_mode} root=\${mmcroot}
uenvcmd=run xyz_message; run loadall; run mmcargs; bootz \${kernel_addr_r} \${ramdisk_addr_r}:\${initrd_size} \${fdt_addr_r}
__EOF__
else
cat >> ${TEMPDIR}/bootscripts/normal.cmd <<-__EOF__
#fdtfile=${dtb}
@ -419,7 +363,6 @@ boot_uenv_txt_template () {
if [ "${uboot_fdt_variable_name}" ] ; then
sed -i -e 's:fdtfile:'$uboot_fdt_variable_name':g' ${TEMPDIR}/bootscripts/*.cmd
fi
fi
if [ "x${drm_read_edid_broken}" = "xenable" ] ; then
sed -i -e 's:#kms_force_mode:kms_force_mode:g' ${TEMPDIR}/bootscripts/*.cmd
@ -1174,11 +1117,7 @@ populate_boot () {
else
echo "Net Install Boot Script:"
if [ "x${conf_config_distro_defaults}" = "xenable" ] ; then
cp -v ${TEMPDIR}/bootscripts/netinstall.cmd ${TEMPDIR}/disk/boot/uEnv.txt
else
cp -v ${TEMPDIR}/bootscripts/netinstall.cmd ${TEMPDIR}/disk/uEnv.txt
fi
cp -v ${TEMPDIR}/bootscripts/netinstall.cmd ${TEMPDIR}/disk/uEnv.txt
echo "-----------------------------"
cat ${TEMPDIR}/bootscripts/netinstall.cmd
rm -rf ${TEMPDIR}/bootscripts/netinstall.cmd || true

Loading…
Cancel
Save