aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/rebuild-cross.sh
blob: a28dbaabd9bccd2f74e7c1cfd17d998373d02ee9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

#
# sudo mkdir -p /mnt/arm64
# sudo mount /data/diskimages/RaspiArm64LightDev-1.2-rw-deb11-arm64-litexdev.root-ext4.img /mnt/arm64
# scripts/build-cross.sh /mnt/arm64
#
# sudo mkdir -p /mnt/arm32
# sudo mount /data/diskimages/RaspiArm32LightDev-1.2-rw-deb10-armhf-litexdev.root-ext4.img /mnt/arm32
# scripts/build-cross.sh /mnt/arm32
#

sdir=`dirname $(readlink -f $0)`
rootdir=`dirname $sdir`
parentdir=`dirname $rootdir`

echo sdir ${sdir}
echo rootdir ${rootdir}
echo parentdir ${parentdir}

export ROOTFS_DIR=$1
shift 1

if [ -z "${ROOTFS_DIR}" ]; then
    echo Usage "$0 <rootfs-dir>"
    exit 1
fi

${sdir}/on_chroot.sh ${ROOTFS_DIR} << EOF
    sh ${sdir}/rebuild.sh
EOF