Skip to content

Commit

Permalink
Fix Bullseye release boot
Browse files Browse the repository at this point in the history
Restructure genbootscr script to be similar to Omnia script.
Replace initrd GZIP compression with XZ which is the only supported
in Bullseye.
  • Loading branch information
tmshlvck committed Oct 17, 2021
1 parent 20b3f2c commit e33a769
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
32 changes: 9 additions & 23 deletions mox/create-sdimg.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
#!/bin/bash
#
# by Tomas Hlavacek ([email protected])
#
# prerequisities - Debian packages:
# apt-get install debootstrap qemu-user qemu-user-static git devscripts u-boot-tools
#
# Linaro GCC 7.3 & toolchain int /opt
#
# $SUDO || root privileges
#

#echo "Not testedi yet. Not supported at this time. Sorry!"
#exit -1
# Copyright (C) 2016-2021 Tomas Hlavacek ([email protected])

MIRROR="http://debian.ignum.cz/debian/"
DEBVER="bullseye"
Expand All @@ -22,6 +11,7 @@ BUILDROOT=`pwd`
ROOTDIR="/turrisroot"



SUDO='/usr/bin/sudo'
if [ "$(id -u)" == "0" ]; then
SUDO=''
Expand Down Expand Up @@ -91,7 +81,7 @@ chown root:root $ROOTDIR/etc/kernel/postinst.d/z99-genbootscr
#mkdir -p $ROOTDIR/lib/firmware/mrvl
#cp files/sd8997_uapsta.bin $ROOTDIR/lib/firmware/mrvl
echo "moxtet" >>/etc/modules
echo "moxtet" >>$ROOTDIR/etc/modules
ENDSCRIPT

if [[ $? != 0 ]]; then
Expand All @@ -103,20 +93,16 @@ fi
$SUDO chroot $ROOTDIR /bin/bash <<ENDSCRIPT
cd /
apt-get -y update
apt-get -y install u-boot-tools
apt-get -y install u-boot-tools initramfs-tools xz-utils
# TODO: Install a package with genbootscr and script to do the following initramfs hack
# change initrd compressions to XZ
sed -r -i 's/^COMPRESS=.*/COMPRESS=xz/' /etc/initramfs-tools/initramfs.conf
apt-get -y install linux-image-arm64
apt-get -y install ssh i2c-tools firmware-atheros crda bridge-utils
sed -ir 's/^[#]*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
## temporary hack for buggy kernels
#if ! [ -d /etc/modprobe.d/ ]; then
# mkdir -p /etc/modprobe.d/
#fi
#cat >/etc/modprobe.d/xhci-blacklist.conf <<EOF
#blacklist xhci-hcd
#blacklist xhci-plat-hcd
#EOF
ENDSCRIPT

# cleanup QEMU
Expand Down
21 changes: 13 additions & 8 deletions mox/files/genbootscr
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@ echo "Kernel Image: $KERNEL_IMAGE"
echo "DT: $DT"
echo "InitRD: $INITRD"

if [ -f "${INITRD}" ]; then
INITRD_SIZE=`printf "0x%x\n" $(stat -c "%s" ${INITRD})`
cat >/boot/boot.txt <<EOF
setenv bootargs 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk1p1 rootwait'
setenv mox_boot 'load mmc 0 \${kernel_addr_r} ${KERNEL_IMAGE}; load mmc 0 \${fdt_addr_r} ${DT}; load mmc 0 \${ramdisk_addr_r} ${INITRD}; booti \${kernel_addr_r} \${ramdisk_addr_r}:${INITRD_SIZE} \${fdt_addr_r};'
setenv bootargs 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk0p1 rootwait'
setenv mox_boot_lk 'load mmc 0 \${kernel_addr_r} ${KERNEL_IMAGE}'
setenv mox_boot_ldt 'load mmc 0 \${fdt_addr_r} ${DT}'
EOF

if [ -f "${INITRD}" ]; then
cat >>/boot/boot.txt <<EOF
setenv mox_boot_lrd 'load mmc 0 \${ramdisk_addr_r} ${INITRD};'
setenv mox_boot_brd 'booti \${kernel_addr_r} \${ramdisk_addr_r}:0x\${filesize} \${fdt_addr_r};'
setenv mox_boot 'run mox_boot_lk; run mox_boot_ldt; run mox_boot_lrd; run mox_boot_brd'
run mox_boot
EOF
else
cat >/boot/boot.txt <<EOF
setenv bootargs 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk1p1 rootwait'
setenv mox_boot 'load mmc 0 \${kernel_addr_r} ${KERNEL_IMAGE}; load mmc 0 \${fdt_addr_r} ${DT}; booti \${kernel_addr_r} - \${fdt_addr_r};'
cat >>/boot/boot.txt <<EOF
setenv mox_boot_brd 'booti \${kernel_addr_r} - \${fdt_addr_r};'
setenv mox_boot 'run mox_boot_lk; run mox_boot_ldt; run mox_boot_brd'
run mox_boot
EOF
#setenv mox_boot 'run selectwan; load mmc 0 \${kernel_addr_r} /@${KERNEL_IMAGE}; load mmc 0 \${fdt_addr_r} /@/boot/dtb-wan\$wan; bootz \${kernel_addr_r} - \${fdt_addr_r};'
fi

rm -f /boot/boot.scr
Expand Down

0 comments on commit e33a769

Please sign in to comment.