mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-30 20:07:55 +00:00
initrdscripts: updates for L4T R36.3
* More drivers are now kernel modules * Switch from ECID to module serial number for forming USB device ID when flashing Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
@@ -2,18 +2,37 @@
|
|||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
mount -t proc proc -o nosuid,nodev,noexec /proc
|
mount -t proc proc -o nosuid,nodev,noexec /proc
|
||||||
mount -t devtmpfs none -o nosuid /dev
|
mount -t devtmpfs none -o nosuid /dev
|
||||||
|
mkdir -m 1777 /dev/shm
|
||||||
|
mkdir -m 0755 /dev/pts
|
||||||
|
mount -t devpts devpts /dev/pts
|
||||||
mount -t sysfs sysfs -o nosuid,nodev,noexec /sys
|
mount -t sysfs sysfs -o nosuid,nodev,noexec /sys
|
||||||
|
|
||||||
|
find /lib/modules -name 'usb_f_*.ko' -type f | while read m; do
|
||||||
|
modprobe -v "$m"
|
||||||
|
done
|
||||||
|
|
||||||
|
find /sys -name modalias | while read m; do
|
||||||
|
modalias=$(cat "$m")
|
||||||
|
modprobe -v "$modalias" 2> /dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
MODULES_TO_LOAD="nvme typec ucsi-ccg tegra-mce watchdog-tegra-t18x"
|
||||||
|
|
||||||
|
for m in $MODULES_TO_LOAD; do
|
||||||
|
modprobe -v "$m"
|
||||||
|
done
|
||||||
|
|
||||||
mount -t configfs configfs -o nosuid,nodev,noexec /sys/kernel/config
|
mount -t configfs configfs -o nosuid,nodev,noexec /sys/kernel/config
|
||||||
|
|
||||||
[ ! /usr/sbin/wd_keepalive ] || /usr/sbin/wd_keepalive &
|
[ ! -e /usr/sbin/wd_keepalive ] || /usr/sbin/wd_keepalive &
|
||||||
|
|
||||||
sernum=$(cat /sys/devices/platform/efuse-burn/ecid 2>/dev/null)
|
sernum=$(cat /proc/device-tree/serial-number)
|
||||||
[ -n "$sernum" ] || sernum=$(cat /sys/module/tegra_fuse/parameters/tegra_chip_uid 2>/dev/null)
|
|
||||||
if [ -n "$sernum" ]; then
|
if [ -n "$sernum" ]; then
|
||||||
# Restricted to 8 characters for the ID_MODEL tag
|
# Restricted to 8 characters for the ID_MODEL tag
|
||||||
sernum=$(printf "%x" "$sernum" | tail -c8)
|
sernum=$(printf "%x" "$sernum" | tail -c8)
|
||||||
fi
|
fi
|
||||||
[ -n "$sernum" ] || sernum="UNKNOWN"
|
[ -n "$sernum" ] || sernum="UNKNOWN"
|
||||||
|
echo "Serial number: $sernum"
|
||||||
UDC=$(ls -1 /sys/class/udc | head -n 1)
|
UDC=$(ls -1 /sys/class/udc | head -n 1)
|
||||||
|
|
||||||
wait_for_storage() {
|
wait_for_storage() {
|
||||||
|
|||||||
@@ -26,10 +26,7 @@ program_spi_partition() {
|
|||||||
# Multiple copies of the BCT get installed at erase-block boundaries
|
# Multiple copies of the BCT get installed at erase-block boundaries
|
||||||
# within the defined BCT partition
|
# within the defined BCT partition
|
||||||
if [ "$partname" = "BCT" ]; then
|
if [ "$partname" = "BCT" ]; then
|
||||||
local slotsize=$(cat /sys/class/mtd/mtd0/erasesize)
|
local slotsize=16384
|
||||||
if [ -z "$slotsize" ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
local rounded_slot_size=$(expr \( \( $slotsize \+ 511 \) / 512 \) \* 512)
|
local rounded_slot_size=$(expr \( \( $slotsize \+ 511 \) / 512 \) \* 512)
|
||||||
local curr_offset=$(expr $part_offset \+ $rounded_slot_size)
|
local curr_offset=$(expr $part_offset \+ $rounded_slot_size)
|
||||||
local copycount=$(expr $part_size / $rounded_slot_size)
|
local copycount=$(expr $part_size / $rounded_slot_size)
|
||||||
|
|||||||
@@ -29,5 +29,8 @@ do_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FILES:${PN} = "/"
|
FILES:${PN} = "/"
|
||||||
RDEPENDS:${PN} = "util-linux-blkdiscard tegra-flash-reboot mtd-utils e2fsprogs-mke2fs libusbgx-tegra-initrd-flash watchdog-keepalive gptfdisk"
|
RDEPENDS:${PN} = "util-linux-blkdiscard tegra-flash-reboot mtd-utils e2fsprogs-mke2fs libusbgx-tegra-initrd-flash watchdog-keepalive gptfdisk tegra-firmware kmod"
|
||||||
RRECOMMENDS:${PN} = "kernel-module-spi-tegra114 kernel-module-loop"
|
RRECOMMENDS:${PN} = "kernel-module-loop \
|
||||||
|
kernel-module-libcomposite \
|
||||||
|
kernel-module-usb-f-mass-storage \
|
||||||
|
"
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ mount -t devtmpfs none -o nosuid /dev
|
|||||||
mount -t sysfs sysfs -o nosuid,nodev,noexec /sys
|
mount -t sysfs sysfs -o nosuid,nodev,noexec /sys
|
||||||
mount -t efivarfs efivarfs -o nosuid,nodev,noexec /sys/firmware/efi/efivars
|
mount -t efivarfs efivarfs -o nosuid,nodev,noexec /sys/firmware/efi/efivars
|
||||||
|
|
||||||
|
find /sys -name modalias | while read m; do
|
||||||
|
modalias=$(cat "$m")
|
||||||
|
modprobe -v "$modalias" 2> /dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
modprobe -v nvme
|
||||||
|
|
||||||
rootdev=""
|
rootdev=""
|
||||||
opt="rw"
|
opt="rw"
|
||||||
wait=""
|
wait=""
|
||||||
|
|||||||
@@ -25,5 +25,5 @@ do_install() {
|
|||||||
sed -i -e "s#@@TNSPEC_BOOTDEV@@#${TNSPEC_BOOTDEV}#g" ${D}${sysconfdir}/platform-preboot
|
sed -i -e "s#@@TNSPEC_BOOTDEV@@#${TNSPEC_BOOTDEV}#g" ${D}${sysconfdir}/platform-preboot
|
||||||
}
|
}
|
||||||
|
|
||||||
RDEPENDS:${PN} = "util-linux-blkid"
|
RDEPENDS:${PN} = "util-linux-blkid kmod"
|
||||||
FILES:${PN} = "/"
|
FILES:${PN} = "/"
|
||||||
|
|||||||
Reference in New Issue
Block a user