Breadcrumbs

LiveSystem

The LiveSystem is a microSD/USB Flash drive that has an entire linux operating system on it.

This allows a user to boot into the LiveSystem operating system without having to modify anything on the main internal flash/drive.

The LiveSystem supports various functions/services such as backup, restore, swupdate and several diaganosic tools.

LiveSystem Image

URL Images: ftp://kontron_pub:WENZtA6i@ftp.kontron.ch/WebPanel/Images

Device (Article-Nr)

Image Name

LiveSystem Image Article-Nr

Description

11432, 11379,

11378, 11331, 11554,

11386, 11387,

11351,

11521,

Linux WPC Live System imx6

00944

LiveSystem for imx6 Devices

11414,

BL/AL i.MX6UL/ULL, 11562, 11745, 11748, 11777

Linux WPC Live System imx6

00944

LiveSystem for imx6 Devices

11542, 11592, 11593

Debian Live x64 Backup & Restore

01011

LiveSystem for x86 Devices

11589, 11590, 11591,
11610, 11611, 11613

Linux WPC Live System i.MX8

01041

LiveSystem for imx8 Devices

BL/AL i.MX8MM, 11766, 11771, 11783, 11802,

Linux WPC Live System i.MX8

01041

LiveSystem for imx8 Devices





Files included in the Download (zip file):

[FILE].img.gz: 

The compressed image file can be copied to a memory card using an imager tool (e.g. USB Image Tool).
The image contains a partition table (MBR) with a boot partition with all necessary files from the live system.
The area between MBR (1st sector) and the boot partition is large enough to store a bootloader image.
However, the image does not contain a boot loader. This is only installed on the storage medium during the backup process or with the tool live-update-bootmedia
on the storage medium.

[FILE].livesystem.tar.gz: 

The compressed archive can be extracted to a FAT formatted storage medium (memory card, USB stick). With a storage medium
the boot system cannot be installed afterwards. To boot from this storage medium, a boot system must be installed on the target device.

microSD or USB Stick Content

Scheme on microSD or USB Stick

Content

Description

Image on microSD/USB Stick

This is the content of a media (sdcard/usb stick, with [FILE].img.gz)

Bootloader

With the bootloader the device can boot independently even if the device has a corrupt or no content on the internal flash.

The bootloader on the media is only supported using microSD cards.

DOS Partition

The DOS Partition of the media contains:

  • Linux LiveSystem (unzipped content of [FILE].livesystem.tar.gz)

  • RAW Backup Image or a SWU File

The LiveSystem Images are preconfigured

  • Boot Entry: swupdate

  • backup: backup the full system (disks, bootloader, sram)

Using the LiveSystem to Backup a Device (RAW Backup Format)

  1. Download the livesystem image from the FTP server.

  2. Write the livesystem image to a microSD card with the UBS Image Tool.

  3. Edit the file /config/boot.conf, set line containing "BOOTENTRY" to "BOOTENTRY=backup".

  4. Edit the file config/backup/backup.conf and uncomment Line "#CREATE_BOOTABLE_MEDIA=yes" and uncomment block "# sram" if you want to backup the sram on the device.

  5. Power Off your Device. 

  6. Plug this microSD card.

  7. Power On your Device.

  8. Wait till backup finished (if backup was successfull device shuts down, and the microSD card boot beahviour is set to restore the backupd image to the device)

  9. Remove microSD Card

  10. Backup/Read your microSD card with the USB Image Tool.

Using the LiveSystem to Restore a Device with a RAW Backup

  1. Write the backup image (created with RAW Backup) to a microSD card with the UBS Image Tool.

  2. Edit the file /config/boot.conf, set line containing "BOOTENTRY" to "BOOTENTRY=restore".

  3. Power Off your Device. 

  4. Plug this microSD card.

  5. Power On your Device.

  6. Wait till restoring finished (if restoring was successfull the device shuts down)

  7. Remove microSD Card

Using the LiveSystem to Restore a Device with a SWU File (swupdate)

See: SWUPDATE

LiveSystem Functions/Services (used in Boot Config File)

backup

Create raw backup image of a device.

restore

Restore a raw backup image to a device, created with the backup service.

swupdate

Start swupdate server and rescuegui.

Install automatically the swu file located in the root directory of the LiveSystem disk,

"empty"/none/default

Boot LiveSystem and wait for login.

Boot/Service procedure behavior

Boot

Backup

Restore

swupdate

login/default

livesystem_boot.png

livesystem_backup.png

livesystem_restore.png

livesystem_swupdate.png

livesystem_login.png

Log Files

Log Files are automatically created in the log directory of the microSD card/USB stick

Configuration Files

The LiveSystem behavior is controlled by configuration files.

Boot

File: config/boot.conf

Optionname

Description

Default

BOOTENTRY

# swupdate: install swu file, start swupdate server and rescuegui
# backup: create raw backup image of system with partclone/dd
# restore: restore raw backup image
# default: wait for login

More information about Bootentry options below

wait for login

CONSOLE_DEVICES

# list of linux console devices separated by spaces
# format: device[,options]
# default: none


LOGIN_DEVICES

# space separated list of tty devices which allow login
# format: virtual_console_device | serial_device,baud
# default: no login

no login

IPCONF

Let you specify the name(s) and the options of the interface(s) that should be configured at boot time.

# IPCONF=[DEVICE]:[CLIENT_IP]:[NETMASK][:[GATEWAY_IP]:[NAMESERVER]],[,[ DEVICE]:[CLIENT_IP]:[NETMASK][:[GATEWAY_IP]:[NAMESERVER]]]..

dhcp




Backup (if BOOTENTRY=backup is defined)

File: config/backup/backup.conf

Optionname

Description

Default

OUT_MODE

# OUT_MODE=<channel>
# output channel
# psplash | console | ttyX
# select output mode
# Default: console

console

PSPLASH_FONT

# PSPLASH_FONT=<font>
# psplash font select
# radeon | consolas20px
# Default: radeon

radeon

PSPLASH_BG_LOGO

# PSPLASH_BG_LOGO=<file>
# logo to show (only if OUT_MODE=psplash)
# Default: Built-In Logo

Built-In Logo

CREATE_BOOTABLE_MEDIA

# CREATE_BOOTABLE_MEDIA=yes|no
# Create bootable media. An bootable media contains the bootloader from 2nd sector upwards.
# Is only required if the system does not contain a valid bootloader. The BootROM loads the
# bootloader from the sdcard if present.
# Requirement: The start sector of the first partition must be larger than or equal 1920 (960KB).
# Default: no

no





# *** settings for all devices ***


BACKUP_<X>_DESC[IDX]

# BACKUP_<X>_DESC[IDX]=DESC
# Description of this device


BACKUP_<X>_DIR[IDX]

# BACKUP_<X>_DIR[IDX]=DIR
# The device will be backuped to this directory.


BACKUP_<X>_OUTFMT[IDX]

# BACKUP_<X>_OUTFMT[IDX]=FMT
# Defines the format of the generated output. Supported are:
# dir: The system creates the backup files in the directory ${BACKUP_<X>_OUTNAME[IDX]}
# tar,squashfs: The system creates one archive file ${BACKUP_<X>OUTNAME[IDX]}.${BACKUP_<X>_OUTFMT[IDX]}
# which contains all backup files.
# Default: dir


BACKUP_<X>_OUTNAME[IDX]

# BACKUP_<X>_OUTNAME[IDX]=NAME
# The meaning of this setting depends on BACKUP_<X>_OUTFMT[IDX].
# dir: name of the directory
# tar,squashfs: name of the archive exclusive file extension


BACKUP_<X>_PROGRESS_BUDGET[IDX]

# BACKUP_<X>_PROGRESS_BUDGET[IDX]=BUDGET
# BUDGET determines the range in the progress bar for this operation.
# The larger the value, the larger the range.



# *** block devices ***


BACKUP_BLK_DEVICE[IDX]

BACKUP_BLK_DEVPATH[IDX]

# BACKUP_BLK_DEVICE[IDX]=PATTERN
# BACKUP_BLK_DEVPATH[IDX]=PATTERN
# The System determine the device to backup based on device name (BACKUP_BLK_DEVICE[IDX])
# and/or device path (BACKUP_BLK_DEVPATH[IDX]). The System interpret the PATTERN as an
# extended regular expression.


BACKUP_BLK_MODE[IDX]

# BACKUP_BLK_MODE[IDX]=dd|dd-parts|partclone
# Specifies the backup mode. Following modes are available:
dd backup whole disk with dd (default)
dd-parts backup partition table and all sectors of the device
except the sectores after the last partition with dd
partclone backup partition table and all partitions with partclone

# CLEAN_FREE_DISK_SPACE[IDX]=yes|no
# Before starting the backup process, the system cleans free disk space if
# supported
# Default: no



# *** ubi images


BACKUP_UBI_MTD_DEVICE[IDX]

# BACKUP_UBI_MTD_DEVICE[IDX]=DEVICE
# Backup all ubi volumes that are included in the UBI image on the mtd device DEVICE


BACKUP_UBI_SKIP_IF_NOT_FOUND

# BACKUP_UBI_SKIP_IF_NOT_FOUND=yes|no
# skip backup without an error, by default the backup is aborted



# *** mtd device


BACKUP_MTD_DEV[IDX]

BACKUP_MTD_PART[IDX]

# BACKUP_MTD_DEV[IDX]=PATTERN
# BACKUP_MTD_PART[IDX]=PATTERN
# The System determine the device to backup based on device name (BACKUP_MTD_DEV[IDX])
# and/or partition name (BACKUP_MTD_PART[IDX]). The System interpret the PATTERN as an
# extended regular expression.


BACKUP_MTD_SKIP_IF_NOT_FOUND

# BACKUP_MTD_SKIP_IF_NOT_FOUND=yes|no
# skip backup without an error, by default the backup is aborted



# *** u-boot (image and environment, i.MX6/8 only)


BACKUP_UBOOT_DIR

# BACKUP_UBOOT_DIR=DIR
# Backup u-boot image and environment to this directory
# Default: not backup



# *** bios (only x64) ***


BACKUP_BIOS_DIR

# BACKUP_BIOS_DIR=DIR
# Backup the bios setup to directory 'DIR-<BIOS-UID>.
# Default: not backup





Restore (if BOOTENTRY=restore is defined)

File: config/restore/restore.conf

Option

Description

Default

OUT_MODE

# OUT_MODE=<channel>
# output channel
# psplash | console | ttyX
# select output mode
# Default: console

console

PSPLASH_FONT

# PSPLASH_FONT=<font>
# psplash font select
# radeon | consolas20px
# Default: radeon

radeon

DISP_ROT

# display rotation
# DISP_ROT=<angle>
# 0 | 90 | 180 | 270
# Default: 0

0

PSPLASH_BG_LOGO

# PSPLASH_BG_LOGO=<file>
# logo to show (only if OUT_MODE=psplash)
# Default: Built-In Logo

Built-In Logo

RESTORE_IMAGE_BASEDIR

# RESTORE_IMAGE_BASEDIR=DIR
# location of all image files to restore

images folder on LiveSystem disk




ACTION_IF_DONE

# ACTION_IF_DONE=none|poweroff|displayoff|reboot[:<Entry>:<MenuId>]
# Defines the action when the restore successfully done
# Default: none

none

ACTION_IF_FAILED

# ACTION_IF_FAILED=none|poweroff|displayoff|reboot[:<Entry>:<MenuId>]
# Defines the action when the restore failed
# Default: none


BOOT_DFLT_IF_DONE

# BOOT_DFLT_IF_DONE=<Entry>:<Timeout>:<MenuId>
# Defines the default boot configuration when the restore process is
# successfully done.
# Default: not change

Following values for Entry can be specified:
# backup
# restore
# next_device
# Timeout is not supported, must be zero
# MenuId is not supported





swupdate (if BOOTENTRY=swupdate is defined)

File: config/swupdate/swupdate.conf

Option

Description

Default

INSTALL_RULE

# install rule to use, possible values depend on the SWU file, usually
# "stable,update" or "stable,complete".
# format: <software>,<mode>
INSTALL_RULE="stable,complete"

stable,complete

BORDINFO

# use this board name and hardware revision to check hw compatibility
# format: <name:rev>
# default: swupdate reads boardino from file /etc/hwrevision.
# If this file exists in the board's rootfs partition, the live
# system replaces /etc/hwrevision with the founded file at boottime.
# default contents of /etc/hwrevision is '<MACHINE>:1.0' (e.g. imx6-live:1.0)
#BORDINFO="KCH-11555:1.0"

Board Info Variables:

imx6ul/ull: BORDINFO="KCH-ktn-imx6ul-imx6ull:1.0"

imx6: BORDINFO="KCH-40099086:1.0"

imx8mm WPC: BORDINFO="KCH-11555:1.0"

imx8mm-som: BORDINFO="KCH-ktn-mx8mm-som:1.0"

--

PUBLIC_KEYFILE

# public keyfile to use to check swu signature
# default: use dummy key
#PUBLIC_KEYFILE="${MEDIA_BASEDIR}/public.pem"

--

DOWNLOAD_CMD

# swupdate downloader client command string
# default: no download
# format: -u <url> -r <retries> -t <timeout> -a <usr:pwd>
#DOWNLOAD_CMD="-u myurl -r 1 -t 60 -a <user:pw>"

--

WEBSERVER_PORT

# swupdate webserver port
# default: 8081
#WEBSERVER_PORT="8080"

8081

ACTION_ON_SUCCESS

# action to perform if the update successfully completed
# supported actions are shutdown and wait
ACTION_ON_SUCCESS=wait

wait

ACTION_ON_FAILURE

# action to perform if the update fails.
# supported actions are shutdown and wait
ACTION_ON_FAILURE=wait

wait

"empty"/none (if BOOTENTRY is not defined)

File: "none"

Example Backup:

This Tutorial is to Backup an imx8 Device, on a microSD card.

After the backup, the microSD card can directly be used as a restore card.


# To create a backup the following steps are necessary:

# 1. download file 01041xx.img.gz from our FTP server
# 2. extract file 01041xx.img.gz and write it to a microSD card (min. 8GB) using USB Image Tool.
# 3. edit file on microSD "config\boot.conf":

# Content:
# ---------------
# boot configuration

# default boot target
# backup | restore | live | next_device            
# default: live
DEFAULT_TARGET="backup"

# enable login on tty
# list of tty port numbers
# default: no login
#ENABLE_TTY_LOGIN="1"

# linux system console
# default: none
#SYSTEM_CONSOLE=tty1
SYSTEM_CONSOLE=ttymxc2,115200

# Let you specify the name(s) and the options of the interface(s) that should be configured at boot time
# default:dhcp
# IPCONF=[DEVICE]:[CLIENT_IP]:[NETMASK][:[GATEWAY_IP]:[NAMESERVER]]
#        [,[ DEVICE]:[CLIENT_IP]:[NETMASK][:[GATEWAY_IP]:[NAMESERVER]]]...
IPCONF=eth0:192.168.1.100:255.255.255.0
---------------
4. edit file on microSD "config\backup\backup.conf":
Content:
---------------
#!/bin/bash
#
#             backup.conf - configuration file for target 'backup'
#

# predfined variables:
# ${MEDIA_BASEDIR} mount point of the media which contains the backup files


BACKUP_IMAGE_BASEDIR="${MEDIA_BASEDIR}/images"

# general settings
#OUT_MODE=psplash
#PSPLASH_FONT=consolas20px
#DISP_ROT=0
#PSPLASH_BG_LOGO="${MEDIA_BASEDIR}/config/splash-backup.png"
CREATE_BOOTABLE_MEDIA=yes

# root filesystem (ubi device)
#BACKUP_UBI_DESC[0]="root filesystem"
#BACKUP_UBI_MTD_DEVICE[0]="/dev/mtd0$"
#BACKUP_UBI_PROGRESS_BUDGET[0]="50"
#BACKUP_UBI_OUTFMT[0]="dir"
#BACKUP_UBI_OUTNAME[0]="${BACKUP_IMAGE_BASEDIR}/rootfs"
#BACKUP_UBI_SKIP_IF_NOT_FOUND[0]="yes"

# root filesystem (emmc device)
BACKUP_BLK_DESC[0]="root filesystem"
BACKUP_BLK_DEVICE[0]="^/dev/mmcblk0$"
BACKUP_BLK_MODE[0]=partclone
BACKUP_BLK_PROGRESS_BUDGET[0]="110"
BACKUP_BLK_OUTFMT[0]="dir"
BACKUP_BLK_OUTNAME[0]="${BACKUP_IMAGE_BASEDIR}/emmc"
BACKUP_BLK_SKIP_IF_NOT_FOUND[0]="yes"

# u-boot and boot environment (mtd device)
BACKUP_MTD_DESC[0]="boot flash"
#BACKUP_MTD_DEV[0]="^/dev/mtd0$"
BACKUP_MTD_PART[0]="^spi[01].0$"
BACKUP_MTD_PROGRESS_BUDGET[0]="4"
BACKUP_MTD_OUTFMT[0]="dir"
BACKUP_MTD_OUTNAME[0]="${BACKUP_IMAGE_BASEDIR}/bootflash"
BACKUP_MTD_SKIP_IF_NOT_FOUND[0]="yes"

BACKUP_MTD_DESC[1]="bootsystem"
#BACKUP_MTD_DEV[1]="^/dev/mtd0$"
BACKUP_MTD_PART[1]="^u-boot$"
BACKUP_MTD_PROGRESS_BUDGET[1]="4"
BACKUP_MTD_OUTFMT[1]="dir"
BACKUP_MTD_OUTNAME[1]="${BACKUP_IMAGE_BASEDIR}/uboot"
BACKUP_MTD_SKIP_IF_NOT_FOUND[1]="yes"

BACKUP_MTD_DESC[2]="boot environment"
#BACKUP_MTD_DEV[2]="^/dev/mtd1$"
BACKUP_MTD_PART[2]="^u-boot-env$"
BACKUP_MTD_PROGRESS_BUDGET[2]="4"
BACKUP_MTD_OUTFMT[2]="dir"
BACKUP_MTD_OUTNAME[2]="${BACKUP_IMAGE_BASEDIR}/uboot_env"
BACKUP_MTD_SKIP_IF_NOT_FOUND[2]="yes"

# sd card (block device)
#BACKUP_BLK_DESC[1]="sd card"
#BACKUP_BLK_DEVICE[1]="^/dev/mmcblk1$"
#BACKUP_BLK_DEVPATH[1]="mmcblk1"
#BACKUP_BLK_CLEAN_FREE_SPACE[1]=yes
#BACKUP_BLK_PROGRESS_BUDGET[1]="110"
#BACKUP_BLK_OUTFMT[1]="squashfs"
#BACKUP_BLK_OUTNAME[1]="${BACKUP_IMAGE_BASEDIR}/sdcard"

# sram
#BACKUP_FILE_DESC[0]="SRAM"
#BACKUP_FILE_NAME[0]="/sys/class/spi_master/spi0/spi0.0/eeprom"
#BACKUP_FILE_PROGRESS_BUDGET[0]="2"
#BACKUP_FILE_OUTFMT[0]="dir"
#BACKUP_FILE_OUTNAME[0]="${BACKUP_IMAGE_BASEDIR}/sram"


ACTION_IF_DONE=poweroff
ACTION_IF_FAILED=none
BOOT_DFLT_IF_DONE=restore:0

# ---------------
# 5. start device with this microSD card
# 6. now a backup will be created automatically.
# a.	Backup is running (output debug interface and LED is blinking slowly)
# b.	Backup failed (output debug interface and LED flashes fast)
# c.	Backup success (Gert shuts down and LED turns off)
# 7. a backup can take several minutes
# 8. after the device is shut down, the microSD can be removed and used directly as Restore microSD.
# 9. microSD backup via USB Image Tool.

# The backup/restore process does not require any interaction.


Login in LiveSystem

User: root

Password: live

Remarks

  • If the LiveSystem is started from a USB stick, the bootloader on the internal flash is always used.

  • Not all USB sticks are supported (the normal system is booted and not the LiveSystem)

  • Always use the newest LiveSystem version for backups

  • Use microSD cards for backup to save the bootloader

  • Check log files in case of errors

  • Always prefer microSD cards over USB sticks.

  • If you have a imx6ul and imx6ull solution, you will have to create for each cpu type a backup.

Best Practice

  • Always use a microSD card with enabled CREATE_BOOTABLE_MEDIA to backup a system. This allows you to boot from a microSD without any software on the internal flash.

  • See the example configuration, this usually includes the maximum executing.

Error Handling

  • The LiveSystem does not boot from USB stick or the execution is faulty

    • use the microSD card

    • check the log files on the LiveSystem disk

    • check the console output

  • The LiveSystem execution is faulty (backup/restore failed)

    • check the log files on the LiveSystem disk

    • check the console output

  • The LiveSystem does not boot, but the microSD is detected

    • check the console output

    • use the newest version of the LiveSystem

    • use the console to connect to the bootloader (type any key while booting) and use the commandsenv default -asavveenvrestart device