Skip to main content

Image

How to create an bootable qtecOS GNU/Linux image.

Requirements

What you will need:

  • CFast card reader.
  • CFast card.
  • or USB flash drive

img200 img100 img150

Project, release and machine example:

Machineqt5222
ReleaseHafnium
ProjectPublic
info

The qt5222 machine refers to the qtec C-Series Platform.

Linux

Requirements

We will use the BMAP Tools (bmaptool command) to prepare an image disk with the latest qtecOS distro image.

Package Namebmap-tools
DescriptionThe better dd for embedded projects, based on block maps.
Repositoryhttps://github.com/yoctoproject/bmaptool

Assuming your Linux host is based on Debian GNU/Linux, install the package with:

sudo apt update && sudo apt install bmap-tools

Flash your CFast/USB flash drive

  1. Download the wic image and bmap file from the release server.

Example:

File TypeLink
.wichttps://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic
.wic.bmaphttps://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic.bmap
tip

You can download the files from the command line directly using the wget command. Example:

wget https://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic && \
wget https://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic.bmap
  1. Write the wic image to the CFast card or USB flash drive.
sudo bmaptool copy qtecos-image-qt5222.wic /dev/sdX

Replace /dev/sdX with the actual CFast or USB flash device.

tip

Alternative

You can do all in one step, using the following command:

sudo bmaptool copy https://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic /dev/sdX

Replace /dev/sdX with the actual CFast or USB flash device.

tip

An easy way to find the correct disk device address (/dev/sdX) for your CFast or USB flash device is to run the dmesg command right after connecting the device to the computer. The device will be listed as one of the last entries.

Note that running dmesg might require superuser credentials in some systems, in that case use: sudo dmesg and type in the superuser password.

Example output:

msb@QTEC-P53-MSB-Debian:~$ sudo dmesg
[sudo] password for msb:
...
[80614.164481] usb 1-6.4: new high-speed USB device number 14 using xhci_hcd
[80614.369528] usb 1-6.4: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
[80614.369533] usb 1-6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[80614.369537] usb 1-6.4: Product: DataTraveler 3.0
[80614.369540] usb 1-6.4: Manufacturer: Kingston
[80614.369542] usb 1-6.4: SerialNumber: 408D5CBECBBDE7A10916341B
[80614.371241] usb-storage 1-6.4:1.0: USB Mass Storage device detected
[80614.371873] scsi host0: usb-storage 1-6.4:1.0
[80615.373490] scsi 0:0:0:0: Direct-Access Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[80615.374093] sd 0:0:0:0: Attached scsi generic sg0 type 0
[80615.374360] sd 0:0:0:0: [sda] 60604416 512-byte logical blocks: (31.0 GB/28.9 GiB)
[80615.374910] sd 0:0:0:0: [sda] Write Protect is off
[80615.374913] sd 0:0:0:0: [sda] Mode Sense: 45 00 00 00
[80615.375445] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[80615.583375] sda: sda1
[80615.586725] sd 0:0:0:0: [sda] Attached SCSI removable disk

In this case the disk is at /dev/sda.

info

Some systems will auto-mount the disk and you will therefore be unable to write to it with bmap. And a cannot open block device, Device or resource busy error will be returned:

msb@QTEC-P53-MSB-Debian:~$ sudo bmaptool copy https://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic /dev/sda
bmaptool: info: discovered bmap file 'https://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic.bmap'
bmaptool: ERROR: An error occurred, here is the traceback:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/bmaptools/CLI.py", line 116, in open_block_device
descriptor = os.open(path, os.O_WRONLY | os.O_EXCL)

bmaptool: ERROR: cannot open block device '/dev/sda' in exclusive mode: [Errno 16] Device or resource busy: '/dev/sda'

To fix this problem simply unmount the disk with the following command:

umount /dev/sda*

Remember to adjust /dev/sda to the actual CFast or USB flash device.

Windows/macOS

Requirements

You will need to download the balena Etcher etcher tool. Follow the official install instructions and be ready to prepare a qtecOS image into your CFast card.

  1. Download the wic image and bmap file from the release server.

Example:

File TypeLink
.wichttps://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic
.wic.bmaphttps://packages.qtec.com/images/hafnium/qt5222/qtecos-image-qt5222.wic.bmap
  1. Open balena etcher and select the qtecos-image-qt5222.wic file and start flashing.

  2. After flashing is complete, unmount the drive properly from the Windows/macOS host.

note

For more details, you can refer to the following link.