From: Jaehoon Chung Date: Mon, 1 Oct 2018 04:05:49 +0000 (+0900) Subject: scripts: sd_fusing_xu4: add the ramdisk partition X-Git-Tag: submit/tizen/20181031.053034~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de355221bf93025b6f679bac7c61751a656f4871;p=platform%2Fkernel%2Fu-boot.git scripts: sd_fusing_xu4: add the ramdisk partition Add the ramdisk partition as number 7. Change-Id: Ie3a833bbe85fe27e0f751a426e09f8e4616fd09b Signed-off-by: Jaehoon Chung --- diff --git a/scripts/tizen/sd_fusing_xu4.sh b/scripts/tizen/sd_fusing_xu4.sh index e174faf4b3..2e87a3b346 100755 --- a/scripts/tizen/sd_fusing_xu4.sh +++ b/scripts/tizen/sd_fusing_xu4.sh @@ -18,11 +18,11 @@ declare -a PART_TABLE=( "tzsw.bin.hardkernel" "" 2111 512 "params.bin" "" 6272 512 "boot.img" 1 0 512 - "ramdisk.img" 1 0 512 "rootfs.img" 2 0 4M "system-data.img" 3 0 4M "user.img" 5 0 4M "modules.img" 6 0 512 + "ramdisk.img" 7 0 512 ) declare -r -i PART_TABLE_COL=4 @@ -118,18 +118,7 @@ function fusing_image () { print_message 2 "[Fusing $1]" - if [ "$(basename $fusing_img)" == "ramdisk.img" ]; then - umount $device - mkdir mnt_tmp - mount -t vfat $device ./mnt_tmp - cp -f $fusing_img ./mnt_tmp - sync - umount ./mnt_tmp - rmdir mnt_tmp - echo "fusing $fusing_img is done." - else - dd if=$fusing_img | pv -s $input_size | dd of=$device seek=$seek bs=$bs - fi + dd if=$fusing_img | pv -s $input_size | dd of=$device seek=$seek bs=$bs if [ $(basename $fusing_img) == "u-boot-mmc.bin" ];then add_fusing_entry "u-boot" $seek 2048 @@ -181,34 +170,13 @@ function fuse_image () { for ((fuse_idx = 0 ; fuse_idx < $FUSING_BINARY_NUM ; fuse_idx++)) do local filename=${FUSING_BINARY_ARRAY[fuse_idx]} - local tmpname="" case "$filename" in *.tar | *.tar.gz) - if [ $fuse_idx -lt $tmpval ]; then - local tar_contents=`tar tvf $filename | awk 'BEGIN {FS=" "} {print $6}'` - - for content in $tar_contents - do - if [ "$content" == "ramdisk.img" ]; then - tmpname=$filename - filename=${FUSING_BINARY_ARRAY[$tmpval]} - FUSING_BINARY_ARRAY[$tmpval]=$tmpname - break - fi - done - fi - check_binary_format $filename + fuse_image_tarball $filename ;; *) - if [ $fuse_idx -lt $tmpval ]; then - if [ "$filename" == "ramdisk.img" ]; then - tmpname=$filename - filename=${FUSING_BINARY_ARRAY[$tmpval]} - FUSING_BINARY_ARRAY[$tmpval]=$tmpname - fi - fi - check_binary_format $filename + fusing_image $filename ;; esac done @@ -244,19 +212,21 @@ function mkpart_3 () { local -r ROOTFS_SZ=3072 local -r DATA_SZ=512 local -r MODULE_SZ=32 + local -r RAMDISK_SZ=8 if [ $sfdisk_new == 1 ]; then local -r EXTEND_SZ=8 else local -r EXTEND_SZ=4 fi - let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $EXTEND_SZ" + let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $EXTEND_SZ - $RAMDISK_SZ" local -r BOOT=boot local -r ROOTFS=rootfs local -r SYSTEMDATA=system-data local -r USER=user local -r MODULE=modules + local -r RAMDISK=ramdisk if [[ $USER_SZ -le 100 ]] then @@ -273,6 +243,7 @@ function mkpart_3 () { echo "[Extend]"" " $DISK"4" echo " "$USER" " $DISK"5 " $USER_SZ "MB" echo " "$MODULE" " $DISK"6 " $MODULE_SZ "MB" + echo " "$RAMDISK" " $DISK"7 " $RAMDISK_SZ "MB" local MOUNT_LIST=`mount | grep $DISK | awk '{print $1}'` for mnt in $MOUNT_LIST @@ -291,6 +262,7 @@ function mkpart_3 () { 8MiB,,E,- ,${USER_SZ}MiB,,- ,${MODULE_SZ}MiB,,- + ,${RAMDISK_SZ}MiB,,- __EOF__ else sfdisk --in-order --Linux --unit M $DISK <<-__EOF__ @@ -300,6 +272,7 @@ function mkpart_3 () { ,,E,- ,$USER_SZ,,- ,$MODULE_SZ,,- + ,$RAMDISK_SZ,,- __EOF__ fi @@ -308,6 +281,7 @@ function mkpart_3 () { mkfs.ext4 -q ${DISK}3 -L $SYSTEMDATA -F mkfs.ext4 -q ${DISK}5 -L $USER -F mkfs.ext4 -q ${DISK}6 -L $MODULE -F + mkfs.ext4 -q ${DISK}7 -L $RAMDISK -F } function show_usage () {