### Install Minimal OS with debootstrap Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/virt/uml/user_mode_linux_howto_v2.rst Installs a minimal Debian system (Buster in this example) into the mounted filesystem image using `debootstrap`. This command fetches necessary packages from a specified repository and sets up a basic root filesystem. ```shell # debootstrap buster /mnt http://deb.debian.org/debian ``` -------------------------------- ### Starting a UML Instance Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/virt/uml/user_mode_linux_howto_v2.rst Provides an example command to launch a User-Mode Linux instance with specified memory, root filesystem image, network interface, and console configurations. It details how to set RAM, use a disk image, configure tap networking, and direct console output. ```shell # linux mem=2048M umid=TEST \ ubd0=Filesystem.img \ vec0:transport=tap,ifname=tap0,depth=128,gro=1 \ root=/dev/ubda con=null con0=null,fd:2 con1=fd:0,fd:1 ``` -------------------------------- ### DM Setup Create Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/admin-guide/device-mapper/cache-policies.rst An example of creating a mapped device with a cache target using dmsetup, specifying all necessary parameters including policy tunables. ```shell dmsetup create blah --table "0 268435456 cache /dev/sdb /dev/sdc \ /dev/sdd 512 0 mq 4 sequential_threshold 1024 random_threshold 8" ``` -------------------------------- ### Clock Management Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/driver-api/driver-model/platform.rst Example of how to get a clock associated with a platform device. Embedded systems often use clocks for power saving, and they are linked to devices via setup code. ```C clk_get(&pdev->dev, clock_name) ``` -------------------------------- ### Boot Setup Commands and Parameters Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/scsi/sym53c8xx_2.rst Explains how to pass setup commands and parameters to the driver at boot time, either via the bootloader prompt (e.g., LILO) or as arguments to the 'modprobe' command. ```APIDOC Boot Setup Command Syntax: - Commands can be passed at boot time or via modprobe. Example (LILO prompt): lilo: linux root=/dev/sda2 sym53c8xx.cmd_per_lun=4 sym53c8xx.sync=10 sym53c8xx.debug=0x200 - Enables tagged commands (4 per LUN). - Sets synchronous negotiation speed to 10 Mega-transfers/sec. - Sets the DEBUG_NEGO flag. Example (modprobe): modprobe sym53c8xx cmd_per_lun=4 sync=10 debug=0x200 Available Arguments: cmd_per_lun: - Description: Controls the default number of tagged commands per logical unit. - Values: - cmd_per_lun=0 or cmd_per_lun=1: Tagged command queuing disabled. - cmd_per_lun=#tags (#tags > 1): Tagged command queuing enabled. - Note: #tags will be truncated to the 'Maximum number of queued commands' configuration parameter. burst: - Description: Controls burst transfer settings. - Values: - burst=0: Burst transfer disabled. - burst=255: Get burst length from initial IO register settings. ``` -------------------------------- ### Unbindable Mount Example - Setup Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/sharedsubtree.rst Demonstrates the initial setup for using unbindable mounts to replicate a directory tree efficiently, starting with a simple root structure. ```bash # Initial tree structure: # root # / \ # tmp usr ``` -------------------------------- ### BPF Filesystem Setup Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/tools/bpf/bpftool/Documentation/bpftool-cgroup.rst Demonstrates the steps to mount the BPF filesystem and prepare it for BPF program operations. ```shell # mount -t bpf none /sys/fs/bpf/ ``` -------------------------------- ### Example Git Log Command Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/process/submitting-patches.rst An example of how to use the Git log command with a custom pretty format to display commit information, including the 'Fixes:' tag. This is useful for reviewing commit history. ```bash $ git log -1 --pretty=fixes 54a4f0239f2e Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed") ``` -------------------------------- ### Create and Test a Simple Initramfs with Hello World Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/ramfs-rootfs-initramfs.rst This snippet demonstrates how to create a basic C program, compile it statically, package it into a cpio.gz archive, and test it using QEMU. This serves as a fundamental example for understanding initramfs creation and execution. ```c #include #include int main(int argc, char *argv[]) { printf("Hello world!\n"); sleep(999999999); } ``` ```bash gcc -static hello.c -o init echo init | cpio -o -H newc | gzip > test.cpio.gz qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero ``` -------------------------------- ### Example: Starting ADSL Connection Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/networking/device_drivers/atm/cxacru.rst Example of how to start the ADSL connection for the cxacru device by writing 'start' to the 'adsl_state' sysfs attribute. ```shell echo "start" > /sys/class/atm/cxacru0/adsl_state ``` -------------------------------- ### Co-developed-by and Signed-off-by Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/process/submitting-patches.rst Illustrates the correct structure for commit messages involving co-authorship, demonstrating the required sequence of Co-developed-by: and Signed-off-by: tags for multiple contributors. ```APIDOC Example 1: Patch submitted by the From: author Co-developed-by: First Co-Author Signed-off-by: First Co-Author Co-developed-by: Second Co-Author Signed-off-by: Second Co-Author Signed-off-by: From Author Example 2: Patch submitted by a Co-developed-by: author From: From Author Co-developed-by: Random Co-Author Signed-off-by: Random Co-Author Signed-off-by: From Author Co-developed-by: Submitting Co-Author Signed-off-by: Submitting Co-Author ``` -------------------------------- ### Build OrangeFS from Source Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/orangefs.rst Provides instructions for building OrangeFS from source code, including configuration with specific backends, compilation, installation, and generating configuration files. It also covers starting the server and client, and mounting the filesystem. ```shell ./configure --prefix=/opt/ofs --with-db-backend=lmdb --disable-usrint make make install # Create an orangefs config file /opt/ofs/bin/pvfs2-genconfig /etc/pvfs2.conf # Create an /etc/pvfs2tab file echo tcp://localhost:3334/orangefs /pvfsmnt pvfs2 defaults,noauto 0 0 > \ /etc/pvfs2tab # Create the mount point mkdir /pvfsmnt # Bootstrap the server /opt/ofs/sbin/pvfs2-server -f /etc/pvfs2.conf # Start the server /opt/ofs/sbin/pvfs2-server /etc/pvfs2.conf # Test the server /opt/ofs/bin/pvfs2-ls /pvfsmnt # Load kernel module and turn on client core /opt/ofs/sbin/pvfs2-client -p /opt/ofs/sbin/pvfs2-client-core # Mount your filesystem mount -t pvfs2 tcp://`hostname`:3334/orangefs /pvfsmnt ``` -------------------------------- ### dmsetup Create Cache Device Examples Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/admin-guide/device-mapper/cache.rst Examples demonstrating how to create a cache device using the `dmsetup create` command with various configurations for block size, cache type, and policy arguments. ```shell dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0' ``` ```shell dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ /dev/mapper/ssd /dev/mapper/origin 1024 1 writeback \ mq 4 sequential_threshold 1024 random_threshold 8' ``` -------------------------------- ### Setup Static CPUHP State Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/core-api/cpu_hotplug.rst Demonstrates how to set up a statically allocated CPUHP state for notifications on CPU online and offline operations. It includes registering callback functions for subsystem starting and dying events. ```c int ret; ret = cpuhp_setup_state(CPUHP_SUBSYS_STARTING, "subsys:starting", subsys_cpu_starting, subsys_cpu_dying); if (ret < 0) return ret; /* ... operations ... */ cpuhp_remove_state(CPUHP_SUBSYS_STARTING); ``` -------------------------------- ### Load hvcs Kernel Module with Parameter Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/powerpc/hvcs.rst Example of loading the hvcs kernel module with a parameter to override the default number of tty devices, requesting 4 devices in this case. ```shell insmod hvcs.ko hvcs_parm_num_devs=4 ``` -------------------------------- ### Manually Creating hvcs Device Nodes Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/powerpc/hvcs.rst Provides examples of using the 'mknod' command to manually create persistent device nodes for the hvcs driver. This is necessary if udev does not create them automatically. ```bash mknod /dev/hvcs0 c 254 0 mknod /dev/hvcs1 c 254 1 mknod /dev/hvcs2 c 254 2 mknod /dev/hvcs3 c 254 3 ``` -------------------------------- ### F2FS Basic Usage Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/f2fs.rst Outlines the fundamental steps for using the F2FS filesystem, including loading the kernel module, creating a mount point, formatting a block device, and mounting the filesystem. ```shell # Load the f2fs.ko module if not compiled statically insmod f2fs.ko # Create a directory for mounting mkdir /mnt/f2fs # Format a block device and mount it as f2fs mkfs.f2fs -l label /dev/block_device mount -t f2fs /dev/block_device /mnt/f2fs ``` -------------------------------- ### Build hvcs Driver as Kernel Module Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/powerpc/hvcs.rst Example of selecting the IBM Hypervisor Virtual Console Server Support option as a module () in the kernel's menuconfig, enabling dynamic loading and unloading. ```shell Device Drivers ---> Character devices ---> IBM Hypervisor Virtual Console Server Support ``` -------------------------------- ### bpftool Map Examples: Show, Update, Lookup, Dump, Getnext Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/tools/bpf/bpftool/Documentation/bpftool-map.rst Illustrates common map operations with concrete examples, including showing map details, updating entries, looking up keys, dumping contents, and retrieving the next key. ```shell # bpftool map show :: 10: hash name some_map flags 0x0 key 4B value 8B max_entries 2048 memlock 167936B pids systemd(1) ``` ```shell # bpftool map update id 10 key hex 20 c4 b7 00 value hex 0f ff ff ab 01 02 03 4c # bpftool map update id 10 key 0x20 0xc4 0xb7 0x00 value 0x0f 0xff 0xff 0xab 0x01 0x02 0x03 0x4c # bpftool map update id 10 key 32 196 183 0 value 15 255 255 171 1 2 3 76 ``` ```shell # bpftool map lookup id 10 key 0 1 2 3 :: key: 00 01 02 03 value: 00 01 02 03 04 05 06 07 ``` ```shell # bpftool map dump id 10 :: key: 00 01 02 03 value: 00 01 02 03 04 05 06 07 key: 0d 00 07 00 value: 02 00 00 00 01 02 03 04 Found 2 elements ``` ```shell # bpftool map getnext id 10 key 0 1 2 3 :: key: 00 01 02 03 next key: 0d 00 07 00 ``` -------------------------------- ### Sample Network Interface Configuration Script Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/networking/device_drivers/ethernet/dlink/dl2k.rst Example of a basic network configuration script (ifcfg-ethx) for a Linux system. It defines the device name, IP address, netmask, broadcast address, and boot protocol. ```shell DEVICE=eth0 USERCTL=no ONBOOT=yes POOTPROTO=none BROADCAST=207.200.5.255 NETWORK=207.200.5.0 NETMASK=255.255.255.0 IPADDR=207.200.5.2 ``` -------------------------------- ### SYM-2 Driver Boot Setup Commands Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/scsi/sym53c8xx_2.rst This section details the syntax and available arguments for boot setup commands used to configure the SYM-2 driver at system startup, including options for default commands, burst limits, LED support, and SCSI bus checking. ```APIDOC Boot Setup Commands: Syntax: The boot setup commands follow a specific syntax, typically involving kernel command-line parameters. Available arguments: - Default number of tagged commands: Sets the default number of tagged commands. - Burst max: Configures the maximum burst size. - LED support: Controls LED functionality. - Differential mode: Sets the SCSI differential mode. - IRQ mode: Configures the interrupt request mode. - Check SCSI BUS: Enables or disables SCSI bus checking. - Suggest a default SCSI id for hosts: Assigns a default SCSI ID. - Verbosity level: Sets the initial verbosity level. - Debug mode: Enables or disables initial debug mode. - Settle delay: Configures the signal settle delay. - Serial NVRAM: Enables or disables serial NVRAM support. - Exclude a host from being attached: Prevents a host from being attached. Converting from old options: Information on how to convert older configuration options to the new format. SCSI BUS checking boot option: Specific boot option for enabling SCSI BUS checking. ``` -------------------------------- ### Run Installed Selftests Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/dev-tools/kselftest.rst Executes the installed kernel selftests. After installation, navigate to the installation directory and run the provided script. Some tests may require root privileges. ```shell cd kselftest_install ./run_kselftest.sh ``` -------------------------------- ### ksmbd Setup and Build Instructions Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/smb/ksmbd.rst Steps to download, compile, and install ksmbd-tools, a utility suite for managing the ksmbd kernel module. This includes autogen, configure, and make commands. ```shell # Download ksmbd-tools (e.g., from https://github.com/cifsd-team/ksmbd-tools/releases) # Refer to README for usage details. $ ./autogen.sh $ ./configure --with-rundir=/run $ make && sudo make install ``` -------------------------------- ### Load hvcs Kernel Modules with modprobe Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/powerpc/hvcs.rst Recommended method to load hvcs and hvcserver modules using modprobe, which respects module dependencies defined in modules.dep. This example also sets the number of devices to 4. ```shell modprobe hvcs hvcs_parm_num_devs=4 ``` -------------------------------- ### F2FS Filesystem Management Examples Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/f2fs.rst Demonstrates common filesystem operations using shell commands, including creating F2FS filesystems with device aliasing, mounting, checking disk usage, and manipulating file flags using the f2fs_io utility. ```shell # List devices ls /dev/vd* # Create ext4 filesystem on vdc mkfs.ext4 /dev/vdc # Create F2FS filesystem on vdb, aliasing vdc.file mkfs.f2fs -c /dev/vdc@vdc.file /dev/vdb # Mount F2FS filesystem mount /dev/vdb /mnt/f2fs ls -l /mnt/f2fs # Check disk usage df -h # Mount vdc as ext4 via loop device mount -o loop /dev/vdc /mnt/ext4 df -h # Unmount ext4 umount /mnt/ext4 # Get flags for the aliased file f2fs_io getflags /mnt/f2fs/vdc.file # Set flags (e.g., remove immutable) f2fs_io setflags noimmutable /mnt/f2fs/vdc.file # Remove the aliased file to release space rm /mnt/f2fs/vdc.file ``` -------------------------------- ### Linux Boot Process with initrd Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/admin-guide/initrd.rst Describes the typical steps involved when a system boots using an initrd, from loading the minimal kernel to installing the boot loader. ```APIDOC Linux Boot Process with initrd: 1. System boots from minimal kernel (e.g., with RAM disk, initrd support). 2. Loads initrd. 3. `/sbin/init` in initrd determines requirements for mounting the real root FS and distribution media. 4. `/sbin/init` loads necessary kernel modules. 5. `/sbin/init` creates and populates the root file system. 6. `/sbin/init` invokes `pivot_root` to change the root file system and executes the real `/sbin/init` via chroot. 7. Boot loader is installed. 8. Boot loader is configured to load an initrd with appropriate modules. ``` -------------------------------- ### Commit Message Tags and Linking Conventions Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/process/submitting-patches.rst Examples of standard tags used in Linux kernel commit messages for referencing external discussions, bug reports, and specific fixes. These tags aid in tracking the context and resolution of changes. ```text Link: https://lore.kernel.org/r/30th.anniversary.repost@klaava.Helsinki.FI/ Closes: https://example.com/issues/1234 Fixes: 54a4f0239f2e ("KVM: MMU: make kvm_mmu_zap_page() return the number of pages it actually freed") ``` -------------------------------- ### Base Devicetree Example (foo.dts) Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/devicetree/overlay-notes.rst Illustrates a base Devicetree source file for a 'foo' board, defining compatible devices and resources. ```Devicetree /* FOO platform */ /dts-v1/; / { compatible = "corp,foo"; /* shared resources */ res: res { }; /* On chip peripherals */ ocp: ocp { /* peripherals that are always instantiated */ peripheral1 { }; }; }; ``` -------------------------------- ### Build hvcs Driver Built-in to Kernel Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/powerpc/hvcs.rst Example of selecting the IBM Hypervisor Virtual Console Server Support option within the Linux kernel's menuconfig utility to build the driver directly into the kernel image. ```shell Device Drivers ---> Character devices ---> <*> IBM Hypervisor Virtual Console Server Support ``` -------------------------------- ### seq_file Iterator start() Function Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/seq_file.rst Provides an example implementation of the `start()` function for a seq_file iterator. This function initializes the session and returns an iterator object, taking a position argument and allocating memory for it. ```c static void *ct_seq_start(struct seq_file *s, loff_t *pos) { loff_t *spos = kmalloc(sizeof(loff_t), GFP_KERNEL); if (! spos) ``` -------------------------------- ### Cpuset Setup and Configuration Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/admin-guide/cgroup-v1/cpusets.rst Demonstrates the sequence of shell commands to mount the cpuset filesystem, create a new cpuset named 'Charlie', configure its CPU and memory nodes, attach the current shell as a task, and verify the setup. ```bash mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset cd /sys/fs/cgroup/cpuset mkdir Charlie cd Charlie /bin/echo 2-3 > cpuset.cpus /bin/echo 1 > cpuset.mems /bin/echo $$ > tasks sh cat /proc/self/cpuset ``` -------------------------------- ### ALSA Get Callback Example Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/sound/kernel-api/writing-an-alsa-driver.rst Provides an example of a 'get' callback function used to read the current value of an ALSA control from user-space. It illustrates accessing chip-specific data and filling the value field. ```c static int snd_myctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct mychip *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.integer.value[0] = get_some_value(chip); return 0; } ``` -------------------------------- ### HugeTLB Cgroup Setup and Task Management Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/admin-guide/cgroup-v1/hugetlb.rst Demonstrates mounting the HugeTLB cgroup controller and creating a new cgroup to move processes into. This involves basic shell commands for system administration. ```shell mount -t cgroup -o hugetlb none /sys/fs/cgroup ``` ```shell cd /sys/fs/cgroup ``` ```shell mkdir g1 ``` ```shell echo $$ > g1/tasks ``` -------------------------------- ### setup_data Structure and Usage Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/arch/x86/boot.rst Defines the `setup_data` structure and its usage for an extensible boot parameters passing mechanism. It details the structure's fields, linked list management, and the introduction of `setup_indirect` for larger data objects. ```APIDOC Field name: setup_data Type: write (special) Offset/size: 0x250/8 Protocol: 2.09+ Description: A 64-bit physical pointer to a NULL-terminated single linked list of `struct setup_data`. This mechanism allows for extensible boot parameter passing. struct setup_data: - next: 64-bit physical pointer to the next node in the linked list. The last node's next field is 0. - type: Identifies the contents of the data field. - len: The length of the data field. - data: Holds the real payload. Notes: - The list may be modified during bootup; consider existing entries when modifying. - Awkward for extremely large data objects due to header adjacency and 32-bit length field. struct setup_indirect (introduced in protocol 2.15): - Used for pointing to larger data objects. - type: SETUP_INDIRECT | SETUP_* type. Cannot be SETUP_INDIRECT itself. - reserved: Must be set to zero. - len: Length of the data object (64-bit). - addr: Physical address of the data object. Example of pointing to SETUP_E820_EXT data using setup_indirect: struct setup_data { __u64 next = 0 or ; __u32 type = SETUP_INDIRECT; __u32 len = sizeof(setup_indirect); __u8 data[sizeof(setup_indirect)] = struct setup_indirect { __u32 type = SETUP_INDIRECT | SETUP_E820_EXT; __u32 reserved = 0; __u64 len = ; __u64 addr = ; } } Limitation: - SETUP_INDIRECT | SETUP_NONE objects cannot be properly distinguished from SETUP_INDIRECT itself. ``` -------------------------------- ### Install Selftests Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/dev-tools/kselftest.rst Installs kernel selftests to a user-specified directory. This command requires navigating to the tools/testing/selftests directory and specifying the target installation path. ```shell make -C tools/testing/selftests install INSTALL_PATH=/some/other/path ``` -------------------------------- ### Procfs Mounting and Remounting Examples Source: https://github.com/nothingoss/android_kernel_msm-6.6_nothing_sm8735/blob/sm8735/v/mr/Documentation/filesystems/proc.rst Demonstrates how to mount and remount the procfs filesystem with different options, showing the effects on /proc/mounts and using strace for command tracing. ```shell # Example of initial procfs mount grep ^proc /proc/mounts proc /proc proc rw,relatime,hidepid=2 0 0 # Example of mounting with strace output strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0 +++ exited with 0 +++ # Verifying mounts after strace example grep ^proc /proc/mounts proc /proc proc rw,relatime,hidepid=2 0 0 proc /tmp/proc proc rw,relatime,hidepid=2 0 0 # Example of remounting to change options globally mount -o remount,hidepid=1 -t proc proc /tmp/proc # Verifying mounts after remount grep ^proc /proc/mounts proc /proc proc rw,relatime,hidepid=1 0 0 proc /tmp/proc proc rw,relatime,hidepid=1 0 0 # Example of mounting multiple procfs instances with different options mount -o hidepid=invisible -t proc proc /proc mount -o hidepid=noaccess -t proc proc /tmp/proc # Verifying multiple instances grep ^proc /proc/mounts proc /proc proc rw,relatime,hidepid=invisible 0 0 proc /tmp/proc proc rw,relatime,hidepid=noaccess 0 0 ```