From 31e2191610bc16d7d9aa9f038c43995a8ebe19dc Mon Sep 17 00:00:00 2001 From: Chunrong Guo Date: Thu, 25 May 2023 16:06:56 +0800 Subject: [PATCH] e2000: support disk image debian-package-installer: set audio d2000: add ROOTFS_EXT2_SIZE Signed-off-by: Chunrong Guo --- board/phytium/common/debian-package-installer | 1 + board/phytium/genimage-e2000.cfg | 5 ++- board/phytium/grub.cfg | 3 +- configs/phytium_d2000_debian_defconfig | 2 +- .../phytium_d2000_debian_desktop_defconfig | 2 +- configs/phytium_d2000_ubuntu_defconfig | 2 +- configs/phytium_e2000_debian_defconfig | 3 ++ .../phytium_e2000_debian_desktop_defconfig | 3 ++ configs/phytium_e2000_defconfig | 5 ++- configs/phytium_e2000_ubuntu_defconfig | 5 ++- .../phytium_e2000_ubuntu_desktop_defconfig | 4 ++ fs/ext2/ext2.mk | 37 +++---------------- 12 files changed, 30 insertions(+), 42 deletions(-) diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index c89b7b0a..d2e8ce06 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -78,6 +78,7 @@ do_distrorfs_second_stage() { if [ $5 = E2000 ]; then echo 'defaults.pcm.!card phytiumpe220xi2' >> /etc/asound.conf echo 'defaults.ctl.!card phytiumpe220xi2' >> /etc/asound.conf + echo 'default-sink = alsa_output.platform-sound.stereo-fallback' >> /etc/pulse/client.conf fi # clean cached packages diff --git a/board/phytium/genimage-e2000.cfg b/board/phytium/genimage-e2000.cfg index 7544758c..0d5b0ffc 100644 --- a/board/phytium/genimage-e2000.cfg +++ b/board/phytium/genimage-e2000.cfg @@ -31,14 +31,15 @@ image disk.img { partition boot { image = "efi-part.vfat" - partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b offset = 32K bootable = true } partition root { partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + partition-uuid = "0a52c129-7e0f-43ad-989f-d96b07ccdbb2" image = "rootfs.ext2" - size = 3G + size = 6G } } diff --git a/board/phytium/grub.cfg b/board/phytium/grub.cfg index b3c3299b..43e2df04 100644 --- a/board/phytium/grub.cfg +++ b/board/phytium/grub.cfg @@ -2,6 +2,5 @@ set default="0" set timeout="5" menuentry "Buildroot" { - linux /Image root=/dev/sdb2 rootdelay=10 rw - initrd /initrd + linux /Image root=PARTUUID="0a52c129-7e0f-43ad-989f-d96b07ccdbb2" rootdelay=10 rw } diff --git a/configs/phytium_d2000_debian_defconfig b/configs/phytium_d2000_debian_defconfig index 7588dc63..b2406e83 100644 --- a/configs/phytium_d2000_debian_defconfig +++ b/configs/phytium_d2000_debian_defconfig @@ -5,7 +5,7 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -#BR2_TARGET_ROOTFS_EXT2_SIZE="600M" +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" #BR2_TARGET_ROOTFS_INITRAMFS=y #BR2_ROOTFS_RESIZE=y #BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" diff --git a/configs/phytium_d2000_debian_desktop_defconfig b/configs/phytium_d2000_debian_desktop_defconfig index cac7452e..b676ddea 100644 --- a/configs/phytium_d2000_debian_desktop_defconfig +++ b/configs/phytium_d2000_debian_desktop_defconfig @@ -5,7 +5,7 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -#BR2_TARGET_ROOTFS_EXT2_SIZE="600M" +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" #BR2_TARGET_ROOTFS_INITRAMFS=y BR2_ROOTFS_CHOWN=y #BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" diff --git a/configs/phytium_d2000_ubuntu_defconfig b/configs/phytium_d2000_ubuntu_defconfig index 4b751cb7..d43fcd88 100644 --- a/configs/phytium_d2000_ubuntu_defconfig +++ b/configs/phytium_d2000_ubuntu_defconfig @@ -5,7 +5,7 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -#BR2_TARGET_ROOTFS_EXT2_SIZE="600M" +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" #BR2_TARGET_ROOTFS_INITRAMFS=y BR2_ROOTFS_CHOWN=y #BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" diff --git a/configs/phytium_e2000_debian_defconfig b/configs/phytium_e2000_debian_defconfig index e7131e32..fc5a76a6 100644 --- a/configs/phytium_e2000_debian_defconfig +++ b/configs/phytium_e2000_debian_defconfig @@ -5,6 +5,9 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-e2000.cfg" # custom skeleton BR2_ROOTFS_SKELETON_UBUNTU=y diff --git a/configs/phytium_e2000_debian_desktop_defconfig b/configs/phytium_e2000_debian_desktop_defconfig index 9b4f1b9d..b871dc43 100644 --- a/configs/phytium_e2000_debian_desktop_defconfig +++ b/configs/phytium_e2000_debian_desktop_defconfig @@ -5,6 +5,9 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-e2000.cfg" # custom skeleton BR2_ROOTFS_SKELETON_UBUNTU=y diff --git a/configs/phytium_e2000_defconfig b/configs/phytium_e2000_defconfig index ea6f3e0e..722017da 100644 --- a/configs/phytium_e2000_defconfig +++ b/configs/phytium_e2000_defconfig @@ -18,7 +18,10 @@ BR2_ROOTFS_OVERLAY="board/phytium/common/busybox_init_overlay" # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -BR2_TARGET_ROOTFS_EXT2_SIZE="200M" +BR2_TARGET_ROOTFS_EXT2_SIZE="2G" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-e2000.cfg" + # Bootloader BR2_TARGET_GRUB2=y diff --git a/configs/phytium_e2000_ubuntu_defconfig b/configs/phytium_e2000_ubuntu_defconfig index cda38333..a3ce1636 100644 --- a/configs/phytium_e2000_ubuntu_defconfig +++ b/configs/phytium_e2000_ubuntu_defconfig @@ -5,8 +5,9 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y -#BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" -#BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-e2000.cfg" +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-e2000.cfg" # custom skeleton BR2_ROOTFS_SKELETON_UBUNTU=y diff --git a/configs/phytium_e2000_ubuntu_desktop_defconfig b/configs/phytium_e2000_ubuntu_desktop_defconfig index 2c9aa9d8..e2fa134e 100644 --- a/configs/phytium_e2000_ubuntu_desktop_defconfig +++ b/configs/phytium_e2000_ubuntu_desktop_defconfig @@ -5,6 +5,10 @@ BR2_cortex_a53=y # Filesystem BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="5G" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-e2000.cfg" + # custom skeleton BR2_ROOTFS_SKELETON_UBUNTU=y diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk index 75dc4b04..1bfc9b58 100644 --- a/fs/ext2/ext2.mk +++ b/fs/ext2/ext2.mk @@ -28,40 +28,13 @@ ROOTFS_EXT2_DEPENDENCIES = host-e2fsprogs define ROOTFS_EXT2_CMD rm -f $@ - if [ "x$(BR2_ROOTFS_EXT2_SIZE)" != "x" ] - then - $(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(ROOTFS_EXT2_OPTS) $@ \ + $(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(ROOTFS_EXT2_OPTS) $@ \ "$(ROOTFS_EXT2_SIZE)" \ - || { ret=$$?; \ - echo "*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)" 1>&2; \ - exit $$ret; \ - } - else - EXT2_SIZE_E=`du -s $(TARGET_DIR) | cut -f 1` - while true - do - EXT2_SIZE_E=$$(($${EXT2_SIZE_E} + 100 * 1024)) - echo "The size of rootfs.ext2 will set to $${EXT2_SIZE_E}" - $(HOST_DIR)/sbin/mkfs.ext$(BR2_TARGET_ROOTFS_EXT2_GEN) $(ROOTFS_EXT2_OPTS) $@ "$${EXT2_SIZE_E}K" \ - && break - done + || { ret=$$?; \ + echo "*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)" 1>&2; \ + exit $$ret; \ + } - FREE_BLOCK=`dumpe2fs $@ 2>/dev/null | grep -i "^Free blocks" | awk -F ':' '{print $$2}'` - BLOCK_COUNT=`dumpe2fs $@ 2>/dev/null | grep -i "^Block count" | awk -F ':' '{print $$2}'` - BLOCK_SIZE=`dumpe2fs $@ 2>/dev/null | grep -i "^Block size" | awk -F ':' '{print $$2}'` - - FREE_BLOCK=$$(($${FREE_BLOCK}*$${BLOCK_SIZE}/1024)) - BLOCK_COUNT=$$(($${BLOCK_COUNT}*$${BLOCK_SIZE}/1024)) - USED_BLOCK=$$(($${BLOCK_COUNT}-$${FREE_BLOCK})) - - EXT2_SIZE_E=$$(($${USED_BLOCK}*100/90)) - - if [ $$(($${EXT2_SIZE_E} - $${USED_BLOCK})) -le 51200 ] - then - EXT2_SIZE_E=$$(($${USED_BLOCK} + 51200)) - fi - - fi endef ifneq ($(BR2_TARGET_ROOTFS_EXT2_GEN),2)