Skip to content

Commit e33a769

Browse files
committed
Fix Bullseye release boot
Restructure genbootscr script to be similar to Omnia script. Replace initrd GZIP compression with XZ which is the only supported in Bullseye.
1 parent 20b3f2c commit e33a769

File tree

2 files changed

+22
-31
lines changed

2 files changed

+22
-31
lines changed

mox/create-sdimg.sh

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
#!/bin/bash
22
#
3-
# by Tomas Hlavacek ([email protected])
4-
#
5-
# prerequisities - Debian packages:
6-
# apt-get install debootstrap qemu-user qemu-user-static git devscripts u-boot-tools
7-
#
8-
# Linaro GCC 7.3 & toolchain int /opt
9-
#
10-
# $SUDO || root privileges
11-
#
12-
13-
#echo "Not testedi yet. Not supported at this time. Sorry!"
14-
#exit -1
3+
# Copyright (C) 2016-2021 Tomas Hlavacek ([email protected])
154

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

2413

14+
2515
SUDO='/usr/bin/sudo'
2616
if [ "$(id -u)" == "0" ]; then
2717
SUDO=''
@@ -91,7 +81,7 @@ chown root:root $ROOTDIR/etc/kernel/postinst.d/z99-genbootscr
9181
#mkdir -p $ROOTDIR/lib/firmware/mrvl
9282
#cp files/sd8997_uapsta.bin $ROOTDIR/lib/firmware/mrvl
9383
94-
echo "moxtet" >>/etc/modules
84+
echo "moxtet" >>$ROOTDIR/etc/modules
9585
ENDSCRIPT
9686

9787
if [[ $? != 0 ]]; then
@@ -103,20 +93,16 @@ fi
10393
$SUDO chroot $ROOTDIR /bin/bash <<ENDSCRIPT
10494
cd /
10595
apt-get -y update
106-
apt-get -y install u-boot-tools
96+
apt-get -y install u-boot-tools initramfs-tools xz-utils
97+
98+
# TODO: Install a package with genbootscr and script to do the following initramfs hack
99+
# change initrd compressions to XZ
100+
sed -r -i 's/^COMPRESS=.*/COMPRESS=xz/' /etc/initramfs-tools/initramfs.conf
101+
107102
apt-get -y install linux-image-arm64
108103
apt-get -y install ssh i2c-tools firmware-atheros crda bridge-utils
109104
110105
sed -ir 's/^[#]*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
111-
112-
## temporary hack for buggy kernels
113-
#if ! [ -d /etc/modprobe.d/ ]; then
114-
# mkdir -p /etc/modprobe.d/
115-
#fi
116-
#cat >/etc/modprobe.d/xhci-blacklist.conf <<EOF
117-
#blacklist xhci-hcd
118-
#blacklist xhci-plat-hcd
119-
#EOF
120106
ENDSCRIPT
121107

122108
# cleanup QEMU

mox/files/genbootscr

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,25 @@ echo "Kernel Image: $KERNEL_IMAGE"
1919
echo "DT: $DT"
2020
echo "InitRD: $INITRD"
2121

22-
if [ -f "${INITRD}" ]; then
23-
INITRD_SIZE=`printf "0x%x\n" $(stat -c "%s" ${INITRD})`
2422
cat >/boot/boot.txt <<EOF
25-
setenv bootargs 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk1p1 rootwait'
26-
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};'
23+
setenv bootargs 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk0p1 rootwait'
24+
setenv mox_boot_lk 'load mmc 0 \${kernel_addr_r} ${KERNEL_IMAGE}'
25+
setenv mox_boot_ldt 'load mmc 0 \${fdt_addr_r} ${DT}'
26+
EOF
27+
28+
if [ -f "${INITRD}" ]; then
29+
cat >>/boot/boot.txt <<EOF
30+
setenv mox_boot_lrd 'load mmc 0 \${ramdisk_addr_r} ${INITRD};'
31+
setenv mox_boot_brd 'booti \${kernel_addr_r} \${ramdisk_addr_r}:0x\${filesize} \${fdt_addr_r};'
32+
setenv mox_boot 'run mox_boot_lk; run mox_boot_ldt; run mox_boot_lrd; run mox_boot_brd'
2733
run mox_boot
2834
EOF
2935
else
30-
cat >/boot/boot.txt <<EOF
31-
setenv bootargs 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 root=/dev/mmcblk1p1 rootwait'
32-
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};'
36+
cat >>/boot/boot.txt <<EOF
37+
setenv mox_boot_brd 'booti \${kernel_addr_r} - \${fdt_addr_r};'
38+
setenv mox_boot 'run mox_boot_lk; run mox_boot_ldt; run mox_boot_brd'
3339
run mox_boot
3440
EOF
35-
#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};'
3641
fi
3742

3843
rm -f /boot/boot.scr

0 commit comments

Comments
 (0)