From cf5a392602f2b2faff5eeef8bd0ab046043c603a Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 26 May 2018 00:18:57 +0200 Subject: [PATCH] Various updates to build with current (released!) stretch. --- mkimage.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mkimage.sh b/mkimage.sh index 745a209..d450e82 100755 --- a/mkimage.sh +++ b/mkimage.sh @@ -2,10 +2,6 @@ # Install a bog-standard Debian bootable for ODROID XU3/XU4. # -# Note: You will need u-boot-exynos >= 2016.05~rc3+dfsg1-1, -# which at the time of writing is in experimental (it will -# probably eventually hit stretch). -# # Beware: This will ERASE ALL DATA on the target SD card # or MMC partition. # @@ -58,7 +54,7 @@ set -x # Prerequisites. dpkg --add-architecture armhf apt update -apt install git parted dosfstools e2fsprogs binfmt-support qemu qemu-user-static debootstrap zerofree u-boot-exynos:armhf +apt install -t $SUITE git parted dosfstools e2fsprogs binfmt-support qemu qemu-user-static debootstrap zerofree u-boot-exynos:armhf # Get first stages of bootloader. (BL1 must be signed by Hardkernel, # and TZSW comes without source anyway, so we can't build these ourselves) @@ -99,7 +95,7 @@ else fi dd if=u-boot/sd_fuse/hardkernel_1mb_uboot/bl1.bin.hardkernel of=${UBOOT_DEVICE} seek=${UBOOT_OFFSET} conv=sync dd if=u-boot/sd_fuse/hardkernel_1mb_uboot/bl2.bin.hardkernel.1mb_uboot of=${UBOOT_DEVICE} seek=$((UBOOT_OFFSET + 30)) conv=sync -dd if=/usr/lib/u-boot/odroid-xu3/u-boot-dtb.bin of=${UBOOT_DEVICE} seek=$((UBOOT_OFFSET + 62)) conv=sync +dd if=/usr/lib/u-boot/odroid-xu3/u-boot.bin of=${UBOOT_DEVICE} seek=$((UBOOT_OFFSET + 62)) conv=sync dd if=u-boot/sd_fuse/hardkernel_1mb_uboot/tzsw.bin.hardkernel of=${UBOOT_DEVICE} seek=$((UBOOT_OFFSET + 2110)) conv=sync # Clear out the environment. @@ -135,7 +131,7 @@ mkdir -p /mnt/xu4/ mount /dev/odroid/root /mnt/xu4 mkdir /mnt/xu4/boot/ mount ${BOOT_PART} /mnt/xu4/boot -debootstrap --include=linux-image-armmp-lpae,grub-efi-arm,lvm2,isc-dhcp-client --foreign --arch armhf ${SUITE} /mnt/xu4 "$@" +debootstrap --include=grub-efi-arm,lvm2,isc-dhcp-client --foreign --arch armhf ${SUITE} /mnt/xu4 "$@" # Run the second stage debootstrap under qemu (via binfmt_misc). cp /usr/bin/qemu-arm-static /mnt/xu4/usr/bin/ @@ -145,10 +141,15 @@ DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAG # Enable security updates, and apply any that might be waiting. if [ "$SUITE" != "unstable" ] && [ "$SUITE" != "sid" ]; then echo "deb http://security.debian.org $SUITE/updates main" >> /mnt/xu4/etc/apt/sources.list - DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot /mnt/xu4 apt update - DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot /mnt/xu4 apt dist-upgrade + DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot /mnt/xu4 apt -y update + DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot /mnt/xu4 apt -y full-upgrade fi +# Install the kernel; we don't do this as part of debootstrap, because it could +# come from security.d.o and upgrading doesn't work too well on FAT (due to +# missing hardlinks). (Admittedly, this is a hack.) +DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot /mnt/xu4 apt -y install linux-image-armmp-lpae + # Create an fstab (this is normally done by partconf, in d-i). BOOT_UUID=$( blkid -s UUID -o value ${BOOT_PART} ) cat < /mnt/xu4/etc/fstab @@ -166,15 +167,13 @@ EOF # Set a hostname. echo odroid > /mnt/xu4/etc/hostname -# Work around Debian bug #824391. -echo ttySAC2 >> /mnt/xu4/etc/securetty - # Work around Debian bug #825026. echo ledtrig-heartbeat >> /mnt/xu4/etc/modules # Install GRUB, chainloaded from U-Boot via UEFI. mount --bind /dev /mnt/xu4/dev mount --bind /proc /mnt/xu4/proc +mount --bind /sys /mnt/xu4/sys chroot /mnt/xu4 /usr/sbin/grub-install --removable --target=arm-efi --boot-directory=/boot --efi-directory=/boot # Get the device tree in place (we need it to load GRUB). @@ -217,6 +216,7 @@ rm /mnt/xu4/usr/bin/qemu-arm-static umount /mnt/xu4/dev umount /mnt/xu4/proc umount /mnt/xu4/boot +umount /mnt/xu4/sys umount /mnt/xu4 # The root file system is ext4, so we can use zerofree, which is -- 2.39.2