I work in a really closely regulated business. I have been tasked with making a safe boot chain. That’s, from boot, it must boot right into a minimal Linux Kernel who’s initramfs has a Python init script and extra programming to do integrity checks. As soon as/if the integrity checks are profitable, the consumer can then full the boot.
The init script wants to have the ability to discover the laborious drive and cross it to the integrity checker. Nevertheless, I can’t for the lifetime of me determine how one can accurately mount the foundation filesystem.
I am very new to Linux, so I am making an attempt to piece issues collectively as I am going alongside. From what I’ve gathered:
The initramfs is a short lived file system to permit the mounting of the true root filesystem (often
/dev/sda1, I consider). Nevertheless, there aren’t any sd* recordsdata/nodes after I
ls /dev within the initramfs. I’ve tried implementing some Python code that creates the
sda1 nodes after which creates a filesystem by way of
sda1, however that does not appear to work.
Howdy! That is python 0 // results of mknod /dev/sda b eight 0 0 // results of mknod /dev/sda1 b eight 1 1 mke2fs 1.45.5 (07-Jan-2020) Couldn't open /dev/sda1: No such gadget or tackle 1 df: can't learn desk of mounted file programs: No such file or listing Mounting proc... mount /proc 0 // results of mount /proc Zero Filesystem 1K-blocks Used Obtainable Use% Mounted on // results of df rootfs 202828 202828 0 100% / finish of df 0 # Start /and many others/fstab // results of cat /and many others/fstab # file system mount-point kind choices dump fsck # order /dev/sda / ext4 defaults 1 1 proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 devpts /dev/pts devpts gid=4,mode=620 0 0 shm /dev/shm tmpfs defaults 0 0 # Finish /and many others/fstab finish of fstab Zero main minor #blocks title // results of cat /proc/partitions 11 0 1048575 sr0 finish of /proc/partitions 2 gadget fs_type label mount level UUID // results of blkid -o listing finish of blkid Checking... 0 0 Zero rootfs on / kind rootfs (rw,dimension=202828ok,nr_inodes=50707) // results of mount proc on /proc kind proc (rw,relatime) Cannot discover platform/dev/sda // results of a perform to seek out the required partition on disk Halted.