Browse Source

e2000: support disk image

debian-package-installer: set audio

d2000: add ROOTFS_EXT2_SIZE

Signed-off-by: Chunrong Guo <guochunrong@phytium.com.cn>
pull/8/head
Chunrong Guo 1 year ago
committed by weishanshan1084
parent
commit
31e2191610
  1. 1
      board/phytium/common/debian-package-installer
  2. 5
      board/phytium/genimage-e2000.cfg
  3. 3
      board/phytium/grub.cfg
  4. 2
      configs/phytium_d2000_debian_defconfig
  5. 2
      configs/phytium_d2000_debian_desktop_defconfig
  6. 2
      configs/phytium_d2000_ubuntu_defconfig
  7. 3
      configs/phytium_e2000_debian_defconfig
  8. 3
      configs/phytium_e2000_debian_desktop_defconfig
  9. 5
      configs/phytium_e2000_defconfig
  10. 5
      configs/phytium_e2000_ubuntu_defconfig
  11. 4
      configs/phytium_e2000_ubuntu_desktop_defconfig
  12. 37
      fs/ext2/ext2.mk

1
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

5
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
}
}

3
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
}

2
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"

2
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"

2
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"

3
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

3
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

5
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

5
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

4
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

37
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)

Loading…
Cancel
Save