From 07896631f380b953206ce662311b3fb7b339137c Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Tue, 3 Oct 2017 16:20:14 +0200 Subject: apalis-tk1*: cleanup use of genext script For Apalis TK1 Mainline we can use the generic script from the library. Remove the script with a symlink. For Apalis TK1 we now use a ext4 rootfs. Thus the genext3fs script is no longer needed. Don't deploy it. Signed-off-by: Max Krummenacher Acked-by: Marcel Ziswiler --- .../tegra-uboot-flasher/genext4fs.sh | 81 +--------------------- .../apalis-tk1/tegra-uboot-flasher/genext3fs.sh | 1 - 2 files changed, 1 insertion(+), 81 deletions(-) mode change 100755 => 120000 recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh delete mode 120000 recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh diff --git a/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh b/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh deleted file mode 100755 index 56e79f5..0000000 --- a/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -#creates a file containing a ext4 binary blob of the content of the ../rootfs folder - -# sometimes we need the binary echo, not the shell builtin -ECHO=`which echo` - -MOUNTPOINT="mnt/tdx-rootfs" - -Usage() -{ - echo "creates a file containing a ext4 binary blob. Output file name taken from command line" - echo "Usage: genext4fs.sh [OPTION]... dest_file_name" - echo "-h : Prints this message" - echo "-b : Sets the partition size in MBytes, default 256" - echo "-d : Selects the directory which contains the partition content, default ../rootfs" - echo "" -} - -PARTITIONSIZE=256 -SRCPATH=../rootfs - -while getopts "b:d:h" Option ; do - case $Option in - h) Usage - # Exit if only usage (-h) was specfied. - if [[ "$#" -eq "1" ]] ; then - exit 10 - fi - exit 0 - ;; - b) PARTITIONSIZE=$OPTARG - ;; - d) SRCPATH=$OPTARG - ;; - esac -done -#adjust the commandline arg for the now used options -shift $(($OPTIND - 1)) - -#create the file used for the loopbackdevice and format it for ext4 -#answer y to "is not a block special device" -dd if=/dev/zero of=$@ bs=1024k count=$PARTITIONSIZE -mkfs.ext4 -F -L rootfs $@ -#disable fsck checks based on mount count or time interval -tune2fs -c 0 -i 0 $@ - -#prepare mountpoint for the loopdevice -sudo mkdir -p $MOUNTPOINT -sudo umount $MOUNTPOINT &> /dev/null -sudo rm -rf $MOUNTPOINT/* -#mount the file as a loopdevice -#there seems to be a race between mkfs.ext4 not yet finished and mount already trying to mount, so try until it works -MOUNTED=0 -while [ "$MOUNTED" -eq "0" ] ; do - sync - sleep 1 - sudo mount $@ $MOUNTPOINT/ -o loop -t ext4 - MOUNTED=`mount | grep -c "$MOUNTPOINT"` -done -#extract rootfs into the file -sudo cp -rpP $SRCPATH/* $MOUNTPOINT -if [ "$?" -ne "0" ] ; then - $ECHO -e "\033[1mCopying the rootfs failed.\033[0m" - echo "Check for error messages from cp" - sudo rm $@ - exit 1 -fi - -#unmount again -sudo umount $MOUNTPOINT - -#if the mounting was unsuccesful all rootfs data now still is in MOUNTPOINT, and $@ contains an empty fs -#delete $@ in that case to fail early -sync -FAILED=`ls $MOUNTPOINT | wc -l` -if [ "$FAILED" -ne "0" ] ; then - $ECHO -e "\033[1mMounting the loopdevice $@ failed.\033[0m" - sudo rm $@ - exit 1 -fi diff --git a/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh b/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh new file mode 120000 index 0000000..f7eeef9 --- /dev/null +++ b/recipes-images/images/files/apalis-tk1-mainline/tegra-uboot-flasher/genext4fs.sh @@ -0,0 +1 @@ +../../library/genext4fs.sh \ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh b/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh deleted file mode 120000 index cc716db..0000000 --- a/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh +++ /dev/null @@ -1 +0,0 @@ -../../library/genext3fs.sh \ No newline at end of file -- cgit v1.2.3