diff --git a/features.in/uboot/README b/features.in/uboot/README new file mode 100644 index 00000000..4afda82d --- /dev/null +++ b/features.in/uboot/README @@ -0,0 +1 @@ +Настраивает систему для использования загрузчика uboot. diff --git a/features.in/uboot/config.mk b/features.in/uboot/config.mk new file mode 100644 index 00000000..4d3cdbf4 --- /dev/null +++ b/features.in/uboot/config.mk @@ -0,0 +1,3 @@ +use/uboot: use/kernel + @$(call add_feature) + @$(call add,THE_LISTS,singleboard-tools) diff --git a/features.in/uboot/image-scripts.d/00-uboot-prepare b/features.in/uboot/image-scripts.d/00-uboot-prepare new file mode 100755 index 00000000..5a4c1c1a --- /dev/null +++ b/features.in/uboot/image-scripts.d/00-uboot-prepare @@ -0,0 +1,19 @@ +#!/bin/sh + +[ "$GLOBAL_BASE_BOOTLOADER" = 'uboot' ] || exit 0 + +# installkernel relies on existing extlinux.conf +# with filled in `default' label +mkdir -p /boot/extlinux +cat > /boot/extlinux/extlinux.conf << EOF +menu title ALTLinux Boot Options + +default linux +timeout 20 + +label linux + kernel /boot/vmlinuz + initrd /boot/initrd.img + fdtdir /boot/dtb + append root=LABEL=ROOT ro cma=192M console=tty1 +EOF diff --git a/features.in/uboot/image-scripts.d/90-uboot-config-install b/features.in/uboot/image-scripts.d/90-uboot-config-install new file mode 100755 index 00000000..dcb04600 --- /dev/null +++ b/features.in/uboot/image-scripts.d/90-uboot-config-install @@ -0,0 +1,12 @@ +#!/bin/sh -x + +kver="$(rpm -qa 'kernel-image*' \ + --qf '%{installtime} %{version}-%{name}-%{release}\n' \ + | sort -n \ + | cut -f 2 -d ' ' \ + | sed 's/kernel-image-//')" + +[ -n "$kver" ] || { echo "** unable to deduce kernel version" >&2; exit 1; } + +/sbin/installkernel --uboot --keep-initrd "$kver" +printf 'LABEL=ROOT\t/\text4\tdefaults\t1 1\n' >> /etc/fstab