Closed maggu2810 closed 1 year ago
Hi @maggu2810
Should I create a service that checks if /dev/sda1 exists and if it is missing, it creates it using parted and mkfs.ext4 calls? Hook this before /data is mounted?
The way I've handled this in the past is by using a custom platform-pre-switchroot which will allow you to run custom steps during the init process and before the rootfs is mounted and the remaining services which may need to use the /data
partition try to start.
Since the last time I set this up there have been some new changes in https://github.com/OE4T/meta-tegra/wiki/initrd-flashing-support to support flashing alternate devices at startup, however based on a quick search of the script at https://github.com/OE4T/meta-tegra/blob/master/recipes-bsp/tegra-binaries/tegra-helper-scripts/initrd-flash.sh it appears this will only support flashing other devices when the rootfs is located there ($ROOTFS_DEVICE
). So I suspect your best option is still to use platform-pre-switchroot
or similar.
Hi @dwalkes ,
/etc/platform-pre-switchroot
is a possible hook. Thanks for pointing me to that direction.
I will give it a try.
I am pretty sure I will find it while reading the existing recipes etc. As you did already something similar can you point me to some changes that are necessary? Then I can move forward faster.
Thanks again
I assume I found the most of relevant information.
Hello, I already created a custom distribution for a special board setup. The board I am using consists of a Jetson Xavier NX and a 16 GB SD/MMC (/dev/mmcblk0). Flashing using ./doflash works as expected.
The hardware also contains a 128GB SSD (/dev/sda). I would like to create a GPT partition table, one primary ext4 partition and mount that one as /data.
I tested this setup using the normal doflash, boot the board,
mount -o remount,rw /
, edit fstab to use sda1 as data, parted to create partition layout (mktable, mkpart), mkfs.ext4, ...Now I would like to automate the process, so it requires only a doflash and all is set up automatically.
Can you help me what to do?
I assume one thing I need to do is to define MENDER_DATA_PART to
/dev/sda1
. Correct?How can I automate the the parted + mkfs.ext4 step? Should I create a service that checks if /dev/sda1 exists and if it is missing, it creates it using parted and mkfs.ext4 calls? Hook this before /data is mounted? E.g. something like that:
??