uboot: initial feature

This commit is contained in:
Anton Midyukov 2019-05-30 16:27:25 +07:00 committed by Michael Shigorin
parent 2194c95f68
commit b1c1dd488f
4 changed files with 35 additions and 0 deletions

1
features.in/uboot/README Normal file
View File

@ -0,0 +1 @@
Настраивает систему для использования загрузчика uboot.

View File

@ -0,0 +1,3 @@
use/uboot: use/kernel
@$(call add_feature)
@$(call add,THE_LISTS,singleboard-tools)

View File

@ -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

View File

@ -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