From a5de952c57d22243906b7a21922cfde63ae626b7 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Mon, 4 Mar 2019 09:32:50 +0200 Subject: [PATCH 1/7] .gitignore: Ignore binary and temporary files Ignore all temporary files created during building Linux kernel and image. Signed-off-by: Leon Anavi --- SOFTWARE/A64-TERES/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 SOFTWARE/A64-TERES/.gitignore diff --git a/SOFTWARE/A64-TERES/.gitignore b/SOFTWARE/A64-TERES/.gitignore new file mode 100644 index 00000000..9a150370 --- /dev/null +++ b/SOFTWARE/A64-TERES/.gitignore @@ -0,0 +1,3 @@ +linux-a64 +scripts/*.img +scripts/*.xz From 3f7d25e34288ce12d3554be65748f3491d99a86a Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Mon, 4 Mar 2019 10:36:21 +0200 Subject: [PATCH 2/7] make_rootfs.sh: Make bionic image Add an option to generate bionic image for A64-TERES. Fix execution locale-gen. Suggested-by: Lazar Hristov Signed-off-by: Leon Anavi --- SOFTWARE/A64-TERES/scripts/make_rootfs.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SOFTWARE/A64-TERES/scripts/make_rootfs.sh b/SOFTWARE/A64-TERES/scripts/make_rootfs.sh index 0dec3192..3a98807e 100755 --- a/SOFTWARE/A64-TERES/scripts/make_rootfs.sh +++ b/SOFTWARE/A64-TERES/scripts/make_rootfs.sh @@ -77,6 +77,9 @@ case $DISTRO in xenial) ROOTFS="http://cdimage.ubuntu.com/ubuntu-base/releases/16.04.2/release/ubuntu-base-16.04.2-base-arm64.tar.gz" ;; + bionic) + ROOTFS="http://cdimage.ubuntu.com/ubuntu-base/releases/18.04.2/release/ubuntu-base-18.04-base-arm64.tar.gz" + ;; sid|jessie) ROOTFS="${DISTRO}-base-arm64.tar.gz" METHOD="debootstrap" @@ -282,10 +285,10 @@ EOF rm -f "$DEST/etc/resolv.conf" mv "$DEST/etc/resolv.conf.dist" "$DEST/etc/resolv.conf" ;; - xenial|sid|jessie) + xenial|bionic|sid|jessie) rm "$DEST/etc/resolv.conf" cp /etc/resolv.conf "$DEST/etc/resolv.conf" - if [ "$DISTRO" = "xenial" ]; then + if [ "$DISTRO" = "xenial" -o "$DISTRO" = "bionic" ]; then DEB=ubuntu DEBUSER=olimex DEBUSERPW=olimex @@ -320,12 +323,12 @@ EOF #!/bin/sh set -ex export DEBIAN_FRONTEND=noninteractive -locale-gen en_US.UTF-8 $ADDPPACMD apt-get -y update -apt-get -y install dosfstools curl xz-utils iw rfkill wpasupplicant openssh-server alsa-utils $EXTRADEBS +apt-get -y install dosfstools curl xz-utils iw rfkill wpasupplicant openssh-server alsa-utils locales $EXTRADEBS apt-get -y remove --purge ureadahead apt-get -y update +locale-gen en_US.UTF-8 adduser --gecos $DEBUSER --disabled-login $DEBUSER --uid 1000 chown -R 1000:1000 /home/$DEBUSER dpkg -i /home/prebuilt/* From fc3ae04411008a92a4ef73de622584758514760c Mon Sep 17 00:00:00 2001 From: Lazar Hristov Date: Mon, 4 Mar 2019 10:46:41 +0200 Subject: [PATCH 3/7] make_simpleimage.sh: Fix on mkfs.ext4 options Disable options metadata_csum & 64bit after mkfs.ext4 using tune2fs. Fixes the following error on boot: [ 37.259701] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities [ 37.269247] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities [ 37.288201] JBD2: Unrecognised features on journal [ 37.293429] EXT4-fs (mmcblk0p2): error loading journal [ 37.349186] UDF-fs: warning (device mmcblk0p2): udf_fill_super: No partition found (2) Signed-off-by: Lazar Hristov --- SOFTWARE/A64-TERES/scripts/make_simpleimage.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SOFTWARE/A64-TERES/scripts/make_simpleimage.sh b/SOFTWARE/A64-TERES/scripts/make_simpleimage.sh index 64217124..c71f21f3 100755 --- a/SOFTWARE/A64-TERES/scripts/make_simpleimage.sh +++ b/SOFTWARE/A64-TERES/scripts/make_simpleimage.sh @@ -106,10 +106,11 @@ rm -f ${out}1 # Create additional ext4 file system for rootfs dd if=/dev/zero bs=1M count=$((disk_size-boot_size-part_position/1024)) of=${out}2 - if [[ $(lsb_release -sc) == "bionic" ]]; then - mkfs.ext4 -F -O ^64bit,^csum_metadata -b 4096 -E stride=2,stripe-width=1024 -L rootfs ${out}2 - else - mkfs.ext4 -F -b 4096 -E stride=2,stripe-width=1024 -L rootfs ${out}2 +mkfs.ext4 -F -b 4096 -E stride=2,stripe-width=1024 -L rootfs ${out}2 +if [ $(lsb_release -sc) = "bionic" ]; then + tune2fs -O ^metadata_csum ${out}2 + tune2fs -O ^64bit ${out}2 + resize2fs -s ${out}2 fi #kfs.ext4 -F -b 4096 -E stride=2,stripe-width=1024 -L rootfs ${out}2 dd if=${out}2 conv=notrunc oflag=append bs=1M seek=$((part_position/1024+boot_size)) of="$out" From 5663efdf442d311f2e110e9989951b4ef9694960 Mon Sep 17 00:00:00 2001 From: Lazar Hristov Date: Mon, 4 Mar 2019 10:53:43 +0200 Subject: [PATCH 4/7] .gitignore: Ignore temp files during builds Avoid warnings like the examples below when showing git status: warning: could not open directory 'SOFTWARE/A64-TERES/scripts/teres-build-mqHlyiY5yF/': Permission denied warning: could not open directory 'SOFTWARE/A64-TERES/scripts/teres-build-7DBpdkWsab/': Permission denied warning: could not open directory 'SOFTWARE/A64-TERES/scripts/teres-build-hxppVthocN/': Permission denied warning: could not open directory 'SOFTWARE/A64-TERES/scripts/teres-build-Ii73ok6WQw/': Permission denied warning: could not open directory 'SOFTWARE/A64-TERES/scripts/teres-build-59exex9IfW/': Permission denied warning: could not open directory 'SOFTWARE/A64-TERES/scripts/teres-build-i2QaVQHdXx/': Permission denied Signed-off-by: Lazar Hristov --- SOFTWARE/A64-TERES/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/SOFTWARE/A64-TERES/.gitignore b/SOFTWARE/A64-TERES/.gitignore index 9a150370..606157d8 100644 --- a/SOFTWARE/A64-TERES/.gitignore +++ b/SOFTWARE/A64-TERES/.gitignore @@ -1,3 +1,4 @@ linux-a64 scripts/*.img scripts/*.xz +scripts/teres-build-* From d050e166cd38be64f7c7541cc4b35aaecd74f7a0 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Mon, 4 Mar 2019 14:22:20 +0200 Subject: [PATCH 5/7] make_rootfs.sh: Ensure paths exists before cat Ensure that all paths exists before executing cat. Otherwise the rootfs was not properly generated and the image was not booting. Suggested-by: Lazar Hristov Signed-off-by: Leon Anavi --- SOFTWARE/A64-TERES/scripts/make_rootfs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SOFTWARE/A64-TERES/scripts/make_rootfs.sh b/SOFTWARE/A64-TERES/scripts/make_rootfs.sh index 3a98807e..da9dae52 100755 --- a/SOFTWARE/A64-TERES/scripts/make_rootfs.sh +++ b/SOFTWARE/A64-TERES/scripts/make_rootfs.sh @@ -339,6 +339,7 @@ apt-get clean EOF chmod +x "$DEST/second-phase" do_chroot /second-phase + mkdir -p $DEST/etc/network/interfaces.d/ cat > "$DEST/etc/network/interfaces.d/eth0" < "$DEST/etc/udev/hwdb.d/teres_kmap.hwdb" < "$DEST/etc/udev/hwdb.d/teres_kmap.hwdb" < Date: Tue, 5 Mar 2019 12:18:49 +0200 Subject: [PATCH 6/7] .gitignore: Ignore u-boot and busybox build files Extend the list of ignored artifacts by adding files generated as part of the process for building u-boot and busybox. Signed-off-by: Leon Anavi --- SOFTWARE/A64-TERES/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SOFTWARE/A64-TERES/.gitignore b/SOFTWARE/A64-TERES/.gitignore index 606157d8..33412b9f 100644 --- a/SOFTWARE/A64-TERES/.gitignore +++ b/SOFTWARE/A64-TERES/.gitignore @@ -1,4 +1,8 @@ linux-a64 +u-boot_* scripts/*.img scripts/*.xz scripts/teres-build-* +build/ +busybox/ +initrd.gz From a1d895a8155661cda3d8c88cc448969d450b19f7 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Tue, 5 Mar 2019 12:20:12 +0200 Subject: [PATCH 7/7] make_rootfs.sh: Fix symlink to /etc/resolv.conf Resolve failure in name resolution for Ubuntu images. Create a symbolic link of /etc/resolv.conf that points to: /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf Signed-off-by: Leon Anavi --- SOFTWARE/A64-TERES/scripts/make_rootfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOFTWARE/A64-TERES/scripts/make_rootfs.sh b/SOFTWARE/A64-TERES/scripts/make_rootfs.sh index da9dae52..85918ada 100755 --- a/SOFTWARE/A64-TERES/scripts/make_rootfs.sh +++ b/SOFTWARE/A64-TERES/scripts/make_rootfs.sh @@ -376,7 +376,7 @@ EOF rm -f "$DEST/second-phase" rm -f "$DEST/etc/resolv.conf" rm -f "$DEST"/etc/ssh/ssh_host_* - do_chroot ln -s /run/resolvconf/resolv.conf /etc/resolv.conf + do_chroot ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf ;; *) ;;