Skip to content
Snippets Groups Projects
Commit c6e6b0da authored by Bob Mottram's avatar Bob Mottram
Browse files

More generic names

parent dce7f082
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ enable_serial_console() { ...@@ -38,7 +38,7 @@ enable_serial_console() {
echo "T0:12345:respawn:/sbin/getty -L $device 115200 vt100" >> /etc/inittab echo "T0:12345:respawn:/sbin/getty -L $device 115200 vt100" >> /etc/inittab
} }
beaglebone_flash() { arm_flash() {
# allow flash-kernel to work without valid /proc contents # allow flash-kernel to work without valid /proc contents
# ** this doesn't *really* work, since there are too many checks # ** this doesn't *really* work, since there are too many checks
# that fail in an emulated environment! We'll have to do it by # that fail in an emulated environment! We'll have to do it by
...@@ -50,8 +50,8 @@ beaglebone_flash() { ...@@ -50,8 +50,8 @@ beaglebone_flash() {
fi fi
} }
beaglebone_repack_kernel() { arm_repack_kernel() {
beaglebone_variant="$1" dtb="$1"
arm_loadaddr="$2" arm_loadaddr="$2"
arm_initrd_addr="$3" arm_initrd_addr="$3"
arm_arch="$4" arm_arch="$4"
...@@ -67,24 +67,22 @@ beaglebone_repack_kernel() { ...@@ -67,24 +67,22 @@ beaglebone_repack_kernel() {
# on the kernel command line is completely ignored! repack the initrd # on the kernel command line is completely ignored! repack the initrd
# to remove this evil... # to remove this evil...
echo "info: repacking beaglebone kernel and initrd" echo "info: repacking $dtb kernel and initrd"
bbb_dtb="$beaglebone_variant"
# shellcheck disable=SC2012,SC2086 # shellcheck disable=SC2012,SC2086
kernelVersion=$(ls /usr/lib/*/${bbb_dtb}.dtb | head -1 | cut -d/ -f4) kernelVersion=$(ls /usr/lib/*/${dtb}.dtb | head -1 | cut -d/ -f4)
version=$(echo "$kernelVersion" | sed 's/linux-image-\(.*\)/\1/') version=$(echo "$kernelVersion" | sed 's/linux-image-\(.*\)/\1/')
initRd=initrd.img-$version initRd=initrd.img-$version
vmlinuz=vmlinuz-$version vmlinuz=vmlinuz-$version
# optionally use a separately compiled kernel # optionally use a separately compiled kernel
bbb_dtb_file=/usr/lib/$kernelVersion/${bbb_dtb}.dtb dtb_file=/usr/lib/$kernelVersion/${dtb}.dtb
#if [ -f /boot/bbb.tar.gz ]; then #if [ -f /boot/bbb.tar.gz ]; then
# cd /boot # cd /boot
# tar -xzvf /boot/bbb.tar.gz # tar -xzvf /boot/bbb.tar.gz
# if [ -f /boot/bbb/dtbs/${bbb_dtb}.dtb ]; then # if [ -f /boot/bbb/dtbs/${dtb}.dtb ]; then
# if [ -f /boot/bbb/zImage ]; then # if [ -f /boot/bbb/zImage ]; then
# bbb_dtb_file=/boot/bbb/dtbs/${bbb_dtb}.dtb # dtb_file=/boot/bbb/dtbs/${dtb}.dtb
# vmlinuz=/boot/bbb/zImage # vmlinuz=/boot/bbb/zImage
# fi # fi
# fi # fi
...@@ -101,7 +99,7 @@ beaglebone_repack_kernel() { ...@@ -101,7 +99,7 @@ beaglebone_repack_kernel() {
rm -rf /tmp/initrd-repack rm -rf /tmp/initrd-repack
(cd /boot || exit 24 ; \ (cd /boot || exit 24 ; \
cp "${bbb_dtb_file}" dtb ; \ cp "${dtb_file}" dtb ; \
cat "$vmlinuz" dtb >> temp-kernel ; \ cat "$vmlinuz" dtb >> temp-kernel ; \
mkimage -A "${arm_arch}" -O linux -T kernel -n "Debian kernel ${version}" \ mkimage -A "${arm_arch}" -O linux -T kernel -n "Debian kernel ${version}" \
-C none -a "${arm_loadaddr}" -e "${arm_loadaddr}" -d temp-kernel uImage ; \ -C none -a "${arm_loadaddr}" -e "${arm_loadaddr}" -d temp-kernel uImage ; \
...@@ -265,8 +263,8 @@ EOF ...@@ -265,8 +263,8 @@ EOF
if [ "$arm_flash_name" ]; then if [ "$arm_flash_name" ]; then
case "$arm_flash_name" in case "$arm_flash_name" in
"TI "*) "TI "*)
beaglebone_flash "$arm_flash_name" arm_flash "$arm_flash_name"
beaglebone_repack_kernel "${dtb}" "$arm_loadaddr" "$arm_initrd_addr" "$arm_arch" arm_repack_kernel "${dtb}" "$arm_loadaddr" "$arm_initrd_addr" "$arm_arch"
;; ;;
esac esac
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment