Compare commits
5 Commits
5a1b007fd7
...
a776a5aa96
Author | SHA1 | Date |
---|---|---|
|
a776a5aa96 | |
|
e0d873bbf0 | |
|
d4fdb36d45 | |
|
0b6edeeed7 | |
|
41891a1be6 |
1
Makefile
1
Makefile
|
@ -75,6 +75,7 @@ images/firmware.img: images/sdcard.img
|
||||||
output/update.tar.zstd: \
|
output/update.tar.zstd: \
|
||||||
images/rootfs.squashfs \
|
images/rootfs.squashfs \
|
||||||
images/firmware.img \
|
images/firmware.img \
|
||||||
|
install-update.sh \
|
||||||
.host-tools \
|
.host-tools \
|
||||||
.prepared
|
.prepared
|
||||||
./build-update.sh
|
./build-update.sh
|
||||||
|
|
|
@ -15,6 +15,7 @@ cd linux
|
||||||
../linux.config
|
../linux.config
|
||||||
make -C /usr/src/linux O=${PWD} olddefconfig
|
make -C /usr/src/linux O=${PWD} olddefconfig
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
touch arch/arm64/boot/Image.gz
|
||||||
kver=$(make -s kernelversion)
|
kver=$(make -s kernelversion)
|
||||||
make modules_install INSTALL_MOD_PATH=/mnt/gentoo/usr
|
make modules_install INSTALL_MOD_PATH=/mnt/gentoo/usr
|
||||||
cd -
|
cd -
|
||||||
|
|
|
@ -61,6 +61,10 @@ tar -c -C overlay . \
|
||||||
|
|
||||||
cp -uv /usr/${target}/usr/bin/grub-editenv /mnt/gentoo/usr/bin/
|
cp -uv /usr/${target}/usr/bin/grub-editenv /mnt/gentoo/usr/bin/
|
||||||
|
|
||||||
|
find /mnt/gentoo/usr/${target}/usr/lib/udev/rules.d \
|
||||||
|
-name '*.rules' \
|
||||||
|
-exec mv -t /mnt/gentoo/usr/lib/udev/rules.d/ {} +
|
||||||
|
|
||||||
if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then
|
if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then
|
||||||
mv /mnt/gentoo/etc/udev/hwdb.bin /mnt/gentoo/usr/lib/udev/
|
mv /mnt/gentoo/etc/udev/hwdb.bin /mnt/gentoo/usr/lib/udev/
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,6 +3,7 @@ cat
|
||||||
cp
|
cp
|
||||||
dd
|
dd
|
||||||
df
|
df
|
||||||
|
du
|
||||||
echo
|
echo
|
||||||
env
|
env
|
||||||
false
|
false
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# vim: set sw=4 ts=4 sts=4 et :
|
# vim: set sw=4 ts=4 sts=4 et :
|
||||||
|
|
||||||
|
. /lib/gentoo/functions.sh
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
rc=$?
|
rc=$?
|
||||||
if [ $rc -eq 0 ]; then
|
if [ $rc -eq 0 ]; then
|
||||||
|
@ -10,23 +12,10 @@ die() {
|
||||||
exit $rc
|
exit $rc
|
||||||
}
|
}
|
||||||
|
|
||||||
error() {
|
|
||||||
printf 'ERROR: '
|
|
||||||
info "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_partuuid() {
|
get_partuuid() {
|
||||||
blkid -o value -s PARTUUID "$1"
|
blkid -o value -s PARTUUID "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
info() {
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
echo "$1" >&2
|
|
||||||
elif [ $# -gt 1 ]; then
|
|
||||||
printf "$@" >&2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
set_default_boot() {
|
set_default_boot() {
|
||||||
_rc=0
|
_rc=0
|
||||||
mkdir -p newroot || return
|
mkdir -p newroot || return
|
||||||
|
@ -38,53 +27,55 @@ set_default_boot() {
|
||||||
_kver=${_kernel#vmlinuz-}
|
_kver=${_kernel#vmlinuz-}
|
||||||
_partuuid=$(get_partuuid "$1")
|
_partuuid=$(get_partuuid "$1")
|
||||||
_id=id-${_partuuid}-${_kver}
|
_id=id-${_partuuid}-${_kver}
|
||||||
printf 'Setting default boot entry to %s\n' "${_id}"
|
ebegin 'Setting default boot entry'
|
||||||
grub-editenv /boot/efi/EFI/gentoo/grubenv set "default=${_id}" || rc=$?
|
veindent
|
||||||
|
veinfo "Menu entry ID: ${_id}"
|
||||||
|
veoutdent
|
||||||
|
grub-editenv /boot/efi/EFI/gentoo/grubenv set "default=${_id}" || _rc=$?
|
||||||
|
eend $_rc
|
||||||
umount newroot
|
umount newroot
|
||||||
return $rc
|
return $_rc
|
||||||
}
|
|
||||||
|
|
||||||
warn() {
|
|
||||||
printf 'WARNING: '
|
|
||||||
info "$@"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write_firmware() {
|
write_firmware() {
|
||||||
_rc=0
|
_rc=0
|
||||||
_esp=$(findfs PARTLABEL='EFI System Partition')
|
_esp=$(findfs PARTLABEL='EFI System Partition')
|
||||||
if [ -z "${_esp}" ]; then
|
if [ -z "${_esp}" ]; then
|
||||||
error 'Could not identify EFI System Partition'
|
eerror 'Could not identify EFI System Partition'
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if ! mountpoint -q /boot/efi; then
|
if ! mountpoint -q /boot/efi; then
|
||||||
mount -o ro "${_esp}" /boot/efi \
|
mount -o ro "${_esp}" /boot/efi \
|
||||||
|| warn 'Failed to mount EFI System Partition'
|
|| ewarn 'Failed to mount EFI System Partition'
|
||||||
fi
|
fi
|
||||||
if [ -f /boot/efi/EFI/gentoo/grubenv ]; then
|
if [ -f /boot/efi/EFI/gentoo/grubenv ]; then
|
||||||
info 'Saving current GRUB environment ...'
|
ebegin 'Saving current GRUB environment'
|
||||||
cp /boot/efi/EFI/gentoo/grubenv . \
|
cp /boot/efi/EFI/gentoo/grubenv .
|
||||||
|| warn 'Failed to save GRUB environment'
|
ewend $? 'Failed to save GRUB environment'
|
||||||
fi
|
fi
|
||||||
if mountpoint -q /boot/efi; then
|
if mountpoint -q /boot/efi; then
|
||||||
umount /boot/efi || return
|
umount /boot/efi || return
|
||||||
fi
|
fi
|
||||||
info 'Writing firmware image to EFI System Partition (%s) ...\n' "${_esp}"
|
ebegin "Writing firmware image to EFI System Partition (${_esp})"
|
||||||
dd if=firmware.img of="${_esp}" bs=1M || _rc=$?
|
dd if=firmware.img of="${_esp}" bs=1M || _rc=$?
|
||||||
if [ $_rc -eq 0 ]; then
|
if [ $_rc -eq 0 ]; then
|
||||||
mount -orw "${_esp}" /boot/efi || rc=$?
|
mount -orw "${_esp}" /boot/efi || rc=$?
|
||||||
fi
|
fi
|
||||||
if [ $_rc -eq 0 ]; then
|
if [ $_rc -eq 0 ]; then
|
||||||
if [ -f grubenv ]; then
|
if [ -f grubenv ]; then
|
||||||
printf 'Restoring GRUB environment ...\n'
|
ebegin 'Restoring GRUB environment'
|
||||||
cp grubenv /boot/efi/EFI/gentoo/grubenv || _rc=$?
|
cp grubenv /boot/efi/EFI/gentoo/grubenv || _rc=$?
|
||||||
|
eend $_rc
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
return $_rc
|
return $_rc
|
||||||
}
|
}
|
||||||
|
|
||||||
write_rootfs() {
|
write_rootfs() {
|
||||||
printf 'Writing rootfs image to %s ...\n' "$1"
|
_rc=0
|
||||||
dd if=rootfs.squashfs of="$1" bs=1M
|
ebegin "Writing rootfs image to $1"
|
||||||
|
dd if=rootfs.squashfs of="$1" bs=1M || _rc=$?
|
||||||
|
eend $_rc
|
||||||
}
|
}
|
||||||
|
|
||||||
rc=0
|
rc=0
|
||||||
|
@ -94,10 +85,10 @@ write_rootfs "${newroot}" || die 'Failed to write new rootfs image to disk'
|
||||||
write_firmware || die 'Failed to write new firmware image to disk'
|
write_firmware || die 'Failed to write new firmware image to disk'
|
||||||
if ! set_default_boot "${newroot}"; then
|
if ! set_default_boot "${newroot}"; then
|
||||||
rc=$?
|
rc=$?
|
||||||
error 'Failed to set default boot option'
|
eerror 'Failed to set default boot option'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $rc -eq 0 ]; then
|
if [ $rc -eq 0 ]; then
|
||||||
info 'Successfully installed update'
|
einfo 'Successfully installed update'
|
||||||
fi
|
fi
|
||||||
exit $rc
|
exit $rc
|
||||||
|
|
|
@ -44,3 +44,6 @@ CONFIG_BT=m
|
||||||
CONFIG_IPV6=y
|
CONFIG_IPV6=y
|
||||||
CONFIG_IPV6_SIT=m
|
CONFIG_IPV6_SIT=m
|
||||||
CONFIG_IPV6_SIT_6RD=m
|
CONFIG_IPV6_SIT_6RD=m
|
||||||
|
|
||||||
|
# CONFIG_MEDIA_CEC_SUPPORT is not set
|
||||||
|
# CONFIG_MEDIA_SUPPORT is not set
|
||||||
|
|
|
@ -9,13 +9,24 @@ etc/csh.env
|
||||||
etc/init.d
|
etc/init.d
|
||||||
etc/portage
|
etc/portage
|
||||||
etc/runlevels
|
etc/runlevels
|
||||||
|
usr/aarch64-unknown-linux-gnu
|
||||||
|
usr/include
|
||||||
usr/lib*/*.a
|
usr/lib*/*.a
|
||||||
usr/lib*/cmake
|
usr/lib*/cmake
|
||||||
usr/lib*/pkgconfig
|
usr/lib*/pkgconfig
|
||||||
|
usr/lib/kernel
|
||||||
usr/lib/rpm
|
usr/lib/rpm
|
||||||
|
usr/local
|
||||||
|
usr/share/aclocal
|
||||||
|
usr/share/baselayout
|
||||||
|
usr/share/bash-completion
|
||||||
usr/share/doc
|
usr/share/doc
|
||||||
|
usr/share/factory
|
||||||
usr/share/info
|
usr/share/info
|
||||||
usr/share/man
|
usr/share/man
|
||||||
|
usr/share/pkgconfig
|
||||||
|
usr/share/polkit-1
|
||||||
|
usr/share/zsh
|
||||||
var/cache/edb
|
var/cache/edb
|
||||||
var/db/Makefile
|
var/db/Makefile
|
||||||
var/db/pkg
|
var/db/pkg
|
||||||
|
|
Loading…
Reference in New Issue