UAS blacklist broken USB disk enclosures
This commit is contained in:
parent
483575401b
commit
ab786b312f
@ -29,7 +29,7 @@ fi
|
||||
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
|
||||
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc0,115200"; fi
|
||||
|
||||
setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} ${extraargs}"
|
||||
setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs} consoleblank=0 video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
ext2load mmc 0 ${fdt_addr} /boot/dtb/${fdt_file} || fatload mmc 0 ${fdt_addr} /dtb/${fdt_file} || ext2load mmc 0 ${fdt_addr} /dtb/${fdt_file}
|
||||
ext2load mmc 0 ${ramdisk_addr} /boot/uInitrd || fatload mmc 0 ${ramdisk_addr} uInitrd || ext2load mmc 0 ${ramdisk_addr} uInitrd
|
||||
ext2load mmc 0 ${loadaddr} /boot/zImage || fatload mmc 0 ${loadaddr} zImage || ext2load mmc 0 ${loadaddr} zImage
|
||||
|
||||
@ -26,7 +26,7 @@ if load ${boot_interface} 0:1 ${loadaddr} ${prefix}armbianEnv.txt; then
|
||||
env import -t ${loadaddr} ${filesize}
|
||||
fi
|
||||
|
||||
setenv bootargs "console=ttyS0,115200 root=${rootdev} rootwait rootfstype=${rootfstype} ubootdev=${boot_interface} scandelay loglevel=${verbosity} ${extraargs}"
|
||||
setenv bootargs "console=ttyS0,115200 root=${rootdev} rootwait rootfstype=${rootfstype} ubootdev=${boot_interface} scandelay loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
|
||||
load ${boot_interface} 0:1 ${fdt_addr} ${prefix}dtb/${fdtfile}
|
||||
load ${boot_interface} 0:1 ${ramdisk_addr_r} ${prefix}uInitrd
|
||||
|
||||
@ -256,7 +256,7 @@ fdt addr 0x44000000
|
||||
if test "${cecenable}" = "false"; then fdt rm /cec@101B0000; fi
|
||||
|
||||
# final boot args
|
||||
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} ${extraargs}"
|
||||
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
|
||||
# set DDR frequency
|
||||
dmc ${ddr_freq}
|
||||
|
||||
@ -27,7 +27,7 @@ if test "${console}" = "serial" || test "${console}" = "both"; then setenv conso
|
||||
# get PARTUUID of first partition on SD/eMMC the boot script was loaded from
|
||||
if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi
|
||||
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ${extraargs} ${extraboardargs}"
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
|
||||
|
||||
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ if load ${devtype} ${devnum}:1 ${ramdisk_addr_r} /boot/armbianEnv.txt || load ${
|
||||
env import -t ${ramdisk_addr_r} ${filesize}
|
||||
fi
|
||||
|
||||
setenv bootargs "consoleblank=0 scandelay root=${rootdev} rw console=${console} rootfstype=ext4 loglevel=${verbosity} rootwait ${extraargs}"
|
||||
setenv bootargs "consoleblank=0 scandelay root=${rootdev} rw console=${console} rootfstype=ext4 loglevel=${verbosity} rootwait usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
ext4load ${devtype} ${devnum}:1 ${fdt_addr_r} /boot/dtb/${fdt_file} || fatload ${devtype} ${devnum}:1 ${fdt_addr_r} dtb/${fdt_file} || ext4load ${devtype} ${devnum}:1 ${fdt_addr_r} dtb/${fdt_file}
|
||||
ext4load ${devtype} ${devnum}:1 ${ramdisk_addr_r} /boot/uInitrd || fatload ${devtype} ${devnum}:1 ${ramdisk_addr_r} uInitrd || ext4load ${devtype} ${devnum}:1 ${ramdisk_addr_r} uInitrd
|
||||
ext4load ${devtype} ${devnum}:1 ${kernel_addr_r} /boot/zImage || fatload ${devtype} ${devnum}:1 ${kernel_addr_r} zImage || ext4load ${devtype} ${devnum}:1 ${kernel_addr_r} zImage
|
||||
|
||||
@ -31,7 +31,7 @@ if test "${console}" = "serial" || test "${console}" = "both"; then setenv conso
|
||||
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
|
||||
if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi
|
||||
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ${extraargs} ${extraboardargs}"
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
|
||||
|
||||
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ if test "${console}" = "serial" || test "${console}" = "both"; then setenv conso
|
||||
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
|
||||
if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi
|
||||
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} hdmi.audio=EDID:0 disp.screen0_output_mode=${disp_mode} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ubootsource=${devtype} ${extraargs} ${extraboardargs}"
|
||||
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} hdmi.audio=EDID:0 disp.screen0_output_mode=${disp_mode} panic=10 consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} ubootsource=${devtype} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"
|
||||
|
||||
if test "${disp_mem_reserves}" = "off"; then setenv bootargs "${bootargs} sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_fb_mem_reserve=16"; fi
|
||||
if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi
|
||||
|
||||
@ -24,7 +24,7 @@ fi
|
||||
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
|
||||
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc0,115200"; fi
|
||||
|
||||
setenv bootargs "root=${rootdev} rootfstype=ext4 rootwait ${consoleargs} rd.dm=0 rd.luks=0 rd.lvm=0 rw uart_from_osc loglevel=${verbosity} ${extraargs}"
|
||||
setenv bootargs "root=${rootdev} rootfstype=ext4 rootwait ${consoleargs} rd.dm=0 rd.luks=0 rd.lvm=0 rw uart_from_osc loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
|
||||
ext2load mmc ${mmcdev}:${mmcpart} ${fw_load_addr} /boot/bin/m4startup.fw
|
||||
ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/zImage
|
||||
@ -34,4 +34,4 @@ ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/dtb/${fdt_file}
|
||||
bootz ${loadaddr} ${ramdisk_addr} ${fdt_addr}
|
||||
|
||||
# Recompile with:
|
||||
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
|
||||
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
|
||||
|
||||
@ -24,7 +24,7 @@ if test "${console}" = "display" || test "${console}" = "both"; then setenv cons
|
||||
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc1,115200"; fi
|
||||
|
||||
|
||||
setenv bootargs "root=${rootdev} rootfstype=ext4 rootwait ${consoleargs} video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi ahci_imx.hotplug=1 vt.global_cursor_default=0 loglevel=${verbosity} ${extraargs}"
|
||||
setenv bootargs "root=${rootdev} rootfstype=ext4 rootwait ${consoleargs} video=mxcfb0:dev=hdmi,${disp_mode},if=RGB24,bpp=32 rd.dm=0 rd.luks=0 rd.lvm=0 raid=noautodetect pci=nomsi ahci_imx.hotplug=1 vt.global_cursor_default=0 loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} usb-storage.quirks=${usbstoragequirks} ${extraargs}"
|
||||
|
||||
ext4load mmc 0 ${ramdisk_addr} /boot/uInitrd || fatload mmc 0 ${ramdisk_addr} uInitrd || ext4load mmc 0 ${ramdisk_addr} uInitrd
|
||||
ext4load mmc 0 ${loadaddr} /boot/zImage || fatload mmc 0 ${loadaddr} zImage
|
||||
|
||||
@ -353,6 +353,31 @@ check_sd_card_speed() {
|
||||
fi
|
||||
} # check_sd_card_speed
|
||||
|
||||
add_usb_storage_quirks() {
|
||||
# check for /boot/armbianEnv.txt existence
|
||||
[ -f /boot/armbianEnv.txt ] || return
|
||||
|
||||
# preserve old contents if existent
|
||||
awk -F"=" '/^usbstoragequirks/ {print $2}' </boot/armbianEnv.txt >${TMPFILE}
|
||||
|
||||
# UAS blacklist Norelsys NS1068X and NS1066X since broken. Can be removed once
|
||||
# they're blacklisted upstream
|
||||
[ -s ${TMPFILE} ] || echo "0x2537:0x1066:u,0x2537:0x1068:u" >${TMPFILE}
|
||||
|
||||
# check for connected Seagate or WD HDD enclosures and blacklist them all
|
||||
lsusb | awk -F" " '{print "0x"$6}' | sed 's/:/:0x/' | sort | uniq | while read ; do
|
||||
case ${REPLY} in
|
||||
"0x0bc2:"*|"0x1058:"*)
|
||||
grep -q "${REPLY}" ${TMPFILE} || sed -i "1 s/\$/,${REPLY}:u/" ${TMPFILE}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
read USBQUIRKS <${TMPFILE}
|
||||
sed -i '/^usbstoragequirks/d' /boot/armbianEnv.txt
|
||||
echo "usbstoragequirks=${USBQUIRKS}" >>/boot/armbianEnv.txt
|
||||
} # add_usb_storage_quirks
|
||||
|
||||
case $1 in
|
||||
*start*)
|
||||
# set optimal disk scheduler settings
|
||||
@ -367,6 +392,7 @@ case $1 in
|
||||
# hardware preparation
|
||||
prepare_board &
|
||||
prepare_temp_monitoring &
|
||||
add_usb_storage_quirks &
|
||||
|
||||
# display message, log hardware id to file, write log
|
||||
echo -e "[\e[0;32m ok \x1B[0m] Starting ARM hardware info: $ID (${VERSION})"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user