Customizing the QNX Amazon Machine Image
- manage user accounts, passwords, and groups
- enable root access for SSH
- add files
- add storage and create partitions
- extend the boot process
Managing user accounts, passwords, and groups
When the QNX AMI instance first boots, it prompts you to input new passwords for the root account and the qnxuser account. Once complete, you can login as either root or qnxuser.
You can add users or user groups to the system.
For detailed steps, go to the QNX Neutrino User's Guide
about Managing User Accounts
.
Enable root access for SSH
- In superuser mode, open /etc/ssh/sshd_config.
- Find and change the line “PermitRootLogin no” to “PermitRootLogin yes”.
- Save the configuration file.
- Restart the SSH service to reload the configuration file.
- Confirm that you have root access for SSH.
Adding files
You can use the Momentics IDE or
the scp utility to copy or upload
files from the host to the AMI instance, or vice versa.
For details on the scp command,
go to the scp
entry in the
Utilities Reference.
Currently, the QNX AMI instance has one writeable partition. To display partition information, run mount in the QNX instance terminal. For example:
# mount
/dev/nvme0t178 on / type qnx6
ifs on / type ifs
systempartition union mounted at / (slash), where you can upload (via Momentics or scp) your own libraries, binaries, etc.
Adding more storage
Initially, there is one NVME device (nvme0) associated with the AMI. In the QNX instance terminal, run ls /dev to view the devices:
# ls /dev
bpf pci ptyp4 slog ttyp0 tymem
console pf ptyp5 slog2 ttyp1 urandom
io-sock pfil ptyp6 socket ttyp2 zero
mem pipe ptyp7 stderr ttyp3
mqueue ptyp0 random stdin ttyp4
null ptyp1 sem stdout ttyp5
nvme0 ptyp2 ser1 text ttyp6
nvme0t178 ptyp3 shmem tty ttyp7
To attach an additional volume to an instance,
follow the steps in Attach an Amazon EBS volume to an
instance
at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html.
When the volume is attached to the QNX instance, go in the QNX instance terminal and reboot the instance by running shutdown.
After the instance reboots, the additional associated volume appears as the next NVME device nvmeN, where N is the next available number (e.g., nvme1).
# ls /dev
bpf nvme1 ptyp2 ser1 text ttyp6
console nvme1t179 ptyp3 shmem tty ttyp7
io-sock pci ptyp4 slog ttyp0 tymem
mem pf ptyp5 slog2 ttyp1 urandom
mqueue pfil ptyp6 socket ttyp2 zero
null pipe ptyp7 stderr ttyp3
nvme0 ptyp0 random stdin ttyp4
nvme0t178 ptyp1 sem stdout ttyp5
Partitioning and formatting your storage
-
Create a type 178 partition in nvme1:
Reboot the instance with shutdown.fdisk /dev/nvme1 add -t178
-
Confirm the addition of nvme1t178:
ls /dev
-
Format nvme1t178:
mkqnx6fs /dev/nvme1t178
-
Mount nvme1t178
to your desired pathname:
The mounted path is now available for use.mount /dev/nvme1t178 /pathname
The QNX AMI instance can mount as many disk volumes as required.
For more on the root IFS, go to the QNX Neutrino User's Guide
about Working with Filesystems
.
Extending the boot process
-
startup script
The startup process looks for the existence of the script /var/start_script.sh. The IFS executes the script, integrating its code into the boot process.
-
System Launch and Monitor (SLM) configuration file
The startup process also looks for the existence of an SLM configuration file /etc/slm/slm.conf. The SLM uses this configuration file to start and manage any custom components to run during boot. For details on the slm command, go to the
slm
entry in the Utilities Reference.
All extension options can be as complex or simple as you would like. If the user has their own software lifecycle management tool to manage their application-level software, call either the start_script.sh or the SLM to launch those custom processes, such as starting the customer-specific process for the lifecycle management.