platform/upstream/system-installer.git
10 years agosystem-installer: improve options handling 38/10738/1 accepted/tizen_ivi_panda tizen tizen_ivi_panda accepted/tizen/ivi/panda/20140403.014107 submit/tizen_ivi_panda/20140403.012117
Artem Bityutskiy [Wed, 9 Oct 2013 14:45:27 +0000 (17:45 +0300)]
system-installer: improve options handling

* Move options handling down, to where all the code starts.
* Make it a bit more general, this will make it easier adding more options
  later.
* Add -h option and implement help text.
* Print nice error message in an unsupported option is given, plus print help
  text. The error message will be prefixed with program name.
* Handle "--" separator too.

Change-Id: I5a337b99fce7cb93417341c35368948e872990a9
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
10 years agosystem-installer: add copyright and tabs info for vim 37/10737/1
Artem Bityutskiy [Wed, 9 Oct 2013 14:30:23 +0000 (17:30 +0300)]
system-installer: add copyright and tabs info for vim

Change-Id: Ib58025b09f7e04e9d303f07fd932a6aaf8552ba7
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
10 years agoRename internal configuration variables 36/10736/1
Artem Bityutskiy [Wed, 9 Oct 2013 10:43:23 +0000 (13:43 +0300)]
Rename internal configuration variables

This patch renames all the 'INSTALLERFW_*' variables into 'CFG_*' variables.
The "INSTALLERFW_*" variables come from the "installer framework concept", and
the way we currently use them do not really fit the concept. So it is better to
use a different prefix in order to avoid confusions. Besides, it is a bit
shorter.

So, the installer framework concept is basically about running the same scripts
from within different installers. Currently we have 2 installers - MIC and
system-installer. The idea that both export "INSTALLERFW_*" variables, and then for
common tasks both execute the same script.

For example, installing and configuring gummiboot or extlinux to the target
system is something both system-installer and MIC do. There may be a single script
which can be run by both MIC and system-installer for performing this task.

Currently, system-installer has its own code for configuring extlinux/gummiboot.
MIC has its own. However, we intend to implement it in a separate,
independent script. In fact, Tizen IVI already has it, e.g., see
'setup-efi-ivi'. And the intention would be to generalize it, make it to be
part of the 'system-installer' project, and share between Tizen profiles and
between MIC and system-installer. We are not there yet, though, but I am trying to
get there now.

Thus, "INSTALLERFW_*" variables have to be _defined_ by system-installer / MIC and
_exported_ to the environment, and then the independent scripts (which we call
"installer plugins") will use the variable.

Therefore, using "INSTALLERFW_*" variables internally is confusing.

Now, at the moment 'system-installer' is a very simple script. It lacks
a lot of auto-discovery functionality, and requires a lot of input information.
This information comes from the '/etc/installer.conf' file. For example,
information like partition table type, count of partitions, mount options, etc,
could be automatically discovered.

But this is all-right, because it is good enough for our purposes, and keeps
things simple. We know that the original image is always generated by MIC. And
we have the 'installer-conf-creator' script which can generate the
'installer.conf' using the installer framework variables that MIC exports.

This means that 'installer-conf-creator' is actually an installer framework
_plugin_! We run this plugin from within MIC.

The 'system-installer' script, on the opposite, is _not_ an installer framework
plugin. This script is the _installer_, which can itself run installer
framework plugins.

And it is important to understand that the "INSTALLERFW_*" variables that MIC
defines, and that we then save in 'installer.conf', are _different_ to the
variables that we should export. I mean, the values are different!

For example, in MIC CFG_MOUNT_PREFIX=/, while in system-installer
CFG_MOUNT_PREFIX=/media/tgttmp.XXXXXX. Similar for many other variables.

I hope this explains why using 'INSTALLERFW_*' variables, which come directly
from MIC, inside system-installer is very confusing.

Change-Id: Ib360579e1b104d7879f306ea0f88dcc66042b146
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
10 years agoUpdate changelog accepted/tizen/ivi/genivi accepted/tizen/ivi/stable accepted/tizen_generic tizen_ivi_genivi accepted/tizen/20130925.224718 accepted/tizen/20130925.224817 accepted/tizen/20130926.225752 accepted/tizen/ivi/genivi/20140131.041204 ivi_oct_m2 submit/tizen/20130925.223133 submit/tizen_ivi_genivi/20140131.032943
William Douglas [Wed, 25 Sep 2013 22:31:00 +0000 (15:31 -0700)]
Update changelog

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoRename application to system-installer
William Douglas [Fri, 9 Aug 2013 23:22:17 +0000 (16:22 -0700)]
Rename application to system-installer

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoFix the UUIDs in the target's /boot/loader/entries/*
William Douglas [Mon, 5 Aug 2013 21:18:17 +0000 (14:18 -0700)]
Fix the UUIDs in the target's /boot/loader/entries/*

After the rsync, the installed /boot/loader/entries/* will contain the
PARTUUIDs from the raw image and thus do not correspond with the
PARTUUIDs needed for the target partitions.

The fix here is to iterate through the conf files in the
/boot/loader/entries/ directory and substitute the PARTUUID from the
output of 'blkid', with the old PARTUUID in those files.

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoFix the UUIDs in the target /etc/fstab
Patrick McCarty [Sat, 3 Aug 2013 00:54:46 +0000 (17:54 -0700)]
Fix the UUIDs in the target /etc/fstab

After the rsync, the installed /etc/fstab will contain the UUIDs from
the raw image and thus do not correspond with the UUIDs needed for the
target partitions.

The fix here is to iterate through the partitions after install, get the
UUIDs from the output of 'blkid', and substituting the old UUIDs with
the new ones.

Change-Id: Iee478c2fc93f5685891c0e7374f23c5e85b05610

10 years agoRemove the ACL option for rsync; fails for vfat
Patrick McCarty [Sat, 3 Aug 2013 00:35:26 +0000 (17:35 -0700)]
Remove the ACL option for rsync; fails for vfat

If the "preserve-ACL" option is used when we have a separate /boot
partition with vfat filesystem (for EFI installs), then rsync will
refuse to copy over files from this partition, since ACLs are not
supported on vfat.

The copy succeeds after removing this option.

Change-Id: I64bf3a832346e8d1bb72f755062bda0a3de41e9f

10 years agoUse /etc/fstab for now
Patrick McCarty [Fri, 2 Aug 2013 18:35:44 +0000 (11:35 -0700)]
Use /etc/fstab for now

Eventually we want to switch to use systemd mount units instead of the
fstab, but since the installer will not be generating mount units yet,
the fstab is still required.

Change-Id: I3bc5d2988d159b5fbd652fcc1f37bf57f7fa0ca5

10 years agoSplit extlinux installation into a new function
Patrick McCarty [Thu, 1 Aug 2013 19:43:06 +0000 (12:43 -0700)]
Split extlinux installation into a new function

The extlinux install should only be done for MBR, so split this logic
out into a new function.

Also, use $INSTALLERFW_KERNEL_OPTS in the extlinux.conf instead of the
hardcoded options.

Change-Id: I2669ebcd9d3327ca18a1d6d102b6ee07d274eeaa

10 years agoRemove the plymouth theme symlink
Patrick McCarty [Thu, 1 Aug 2013 19:37:26 +0000 (12:37 -0700)]
Remove the plymouth theme symlink

The plymouth themes for PC will be unified in the future, so there's no
need to create a symlink here for special handling.

Change-Id: I047f77cbf2a3d60006bb6ac1faa91e224992e425

10 years agoRemoving the remaining bits of swap support
Patrick McCarty [Thu, 1 Aug 2013 19:34:53 +0000 (12:34 -0700)]
Removing the remaining bits of swap support

PC is not supporting swap partitions at the moment, so remove the logic
to create the unit files, etc.

Change-Id: I453ea8fa2207f5efc159c83c6855933e66104865

10 years agoMake adjustments for mounting the target partitions
Patrick McCarty [Thu, 1 Aug 2013 19:32:52 +0000 (12:32 -0700)]
Make adjustments for mounting the target partitions

Use the MOUNTPOINT variables from installer.conf to mount the target
partitions, in preparation for the rsync operation.

NOTE: for now, we expect the rootfs partition to be the *last* entry in
installer.conf so that we can mount it first.

Change-Id: If34fb34855790285e32dd86890a2e38c63c8f73d

10 years agoMake adjustments for formatting the target partitions
Patrick McCarty [Thu, 1 Aug 2013 18:47:23 +0000 (11:47 -0700)]
Make adjustments for formatting the target partitions

Use the FSTYPE variables from installer.conf to correctly format the
target partitions.

Change-Id: Ibc87219f241e1e9d8268a4f2768760d6f6a81ee1

10 years agoSplit partitioning logic to either run sfdisk or sgdisk
Patrick McCarty [Thu, 1 Aug 2013 17:59:20 +0000 (10:59 -0700)]
Split partitioning logic to either run sfdisk or sgdisk

Using the input string generated in the appropriate *_options function,
now partition the device using either sfdisk or sgdisk.

Only MBR and GPT are supported, so any other partition table formats are
ignored.

Change-Id: I78ee6bb7fd6077725b30fa5f8622c4ab3c6dcdfc

10 years agoAdd routines to build input strings for sfdisk/sgdisk
Patrick McCarty [Thu, 1 Aug 2013 17:50:21 +0000 (10:50 -0700)]
Add routines to build input strings for sfdisk/sgdisk

To prepare for partitioning the device, build an input string for either
sfdisk (MBR support) or sgdisk (GPT support) by using the INSTALLERFW
variables from /etc/installer.conf.

Change-Id: If30fa2ea22846072f3f8e57f6b1c39365add24e5

10 years agopackaging: require dosfstools and gptfdisk
Patrick McCarty [Thu, 1 Aug 2013 18:11:47 +0000 (11:11 -0700)]
packaging: require dosfstools and gptfdisk

Adds new dependencies for the installer:

- dosfstools, to make 'mkfs.vfat' available for EFI image support
- gptfdisk, to make 'sgdisk' available for non-interactive GPT partitioning

Change-Id: Ica741c6fec799d6abb7002b4ebe32a8ad4fa8fac

10 years agoPartially revert "Move the partition logic to GNU parted"
Patrick McCarty [Thu, 1 Aug 2013 17:37:08 +0000 (10:37 -0700)]
Partially revert "Move the partition logic to GNU parted"

In an upcoming change, we will be building an input string to pass to
sgdisk to support GPT. To simplify the logic in the script, we also can
build an input string for sfdisk, so switch back to sfdisk for now.

This partially reverts commit b667b691fe8d8ae4dfa2558bd1060ea92823f632

Change-Id: Ica44876887c64b3a26808e77dc6d88b07a997818

10 years agoFix indentation of conditional statements
Patrick McCarty [Thu, 1 Aug 2013 18:04:54 +0000 (11:04 -0700)]
Fix indentation of conditional statements

Change-Id: I7e7aca3e3b870dd685012638d4c9ec48c57acff8

10 years agoFix a typo in the conf generator script
Patrick McCarty [Fri, 2 Aug 2013 23:11:31 +0000 (16:11 -0700)]
Fix a typo in the conf generator script

Change-Id: I535c98bcb5c0bc41eea4c2844e70659bb6d9f42b

10 years agoMake use of only shell builtins to loop over partitions
William Douglas [Tue, 30 Jul 2013 18:25:43 +0000 (11:25 -0700)]
Make use of only shell builtins to loop over partitions

Instead of using the external seq and expr programs, use a shell
variable for looping over partitions. In this case the
INSTALLER_FW_PART_COUNT must be checked to have been set by MIC
so do so before starting the loop.

Change-Id: I46fc4603510761bb092fe3217fc82d9dbce87f46
Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoCreate or overwrite on first write to installer.conf
William Douglas [Tue, 30 Jul 2013 18:05:29 +0000 (11:05 -0700)]
Create or overwrite on first write to installer.conf

Ensure that there isn't anything left over in the installer.conf file
before the installer-conf-creator script runs by not using append for
the first write.

This removes implicit assumption that there is not a installer.conf
in place before the installer-conf-creator script runs making things
a little safer.

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoQuote all variables when creating installer.conf
William Douglas [Tue, 30 Jul 2013 17:54:24 +0000 (10:54 -0700)]
Quote all variables when creating installer.conf

Instead of selectively quoting only variables that are expected to
contain whitespace, quote all variables as there are not downsides
for quoting with our use case as this is safer and makes the code
cleaner.

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoUse /bin/sh since we don't need bash features
William Douglas [Tue, 30 Jul 2013 17:05:50 +0000 (10:05 -0700)]
Use /bin/sh since we don't need bash features

Also add options for disabling pathname expansion and exit
immediately if an untested expression fails.

Note we do not set -u as we expect to use unset variables as MIC is
not setting every INSTALLERFW_* variable correctly but this may be
changed in the future.

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoquote vars that may contain spaces
William Douglas [Thu, 25 Jul 2013 19:41:22 +0000 (12:41 -0700)]
quote vars that may contain spaces

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoAdd script to export installer variables from MIC
William Douglas [Tue, 23 Jul 2013 20:00:29 +0000 (13:00 -0700)]
Add script to export installer variables from MIC

This script is intended to be run in MIC %post section so that the
installer will be able to use the same settings as image creation did
to setup the target device's partition, bootloader, and filesystem
types.

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoremove ivi/pc hardcoding
Anas Nashif [Fri, 19 Jul 2013 18:16:09 +0000 (14:16 -0400)]
remove ivi/pc hardcoding

- We now rely on one single configuration file that can be set
when creating images.
- Added option -a to make it work with plymouth when called from
 systemd
- renamed pc-installer -> system-installer
- Cleanup spec

Change-Id: I043cd63675cc455f5f2b7d1c207841d403effbb7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
10 years agoMove the partition logic to GNU parted
Manish Sinha [Tue, 23 Jul 2013 00:44:03 +0000 (17:44 -0700)]
Move the partition logic to GNU parted

Changes
* The partition now depends on parted instead of sfdisk
* The partition table is now gpt instead of msdos
* The exit $RETVAL is removed to avoid sciprt exiting after
  finding the partitions

10 years agoMake pc-installer work for IVI images which use raw image instead of squashfs
Manish Sinha [Mon, 24 Jun 2013 20:48:31 +0000 (13:48 -0700)]
Make pc-installer work for IVI images which use raw image instead of squashfs

Changes
* Check if the image if PC, then use btrfs ignoring any config file
* If it is not a PC image, try to read the installer.conf file to check the existence of
    FILESYSTEM=somefs
* If none work, then try checking what all filesystems are supported by
    installer and the kernel
* Use full /sbin/sfdisk -when installing IVI images, sfdisk cannot be found error
* Create btrfs subvolume only if the filesystem is btrfs
* For squashfs image is not present, then SRCOSMNT as /
* Exclude /media/* from rsync as during IVI, it leads to infinite recursive copy
* Exclude other temporary mount points for virtual filesystems
* Put rootflags=subvol=tizen in extlinux.conf only if it is a PC image
* IVI does not have initramfs, so copy that file only if it is a PC image
* vmlinuz* matches multiple files, so copying it to one single file won't work. Copy
  all the files and then rename vmlinuz to vmlinuz0
* Replace extlinux with /sbin/extlinux
* sync the filesystem before unmount and not after
* Use echo when plymouth isn't available

Signed-off-by: Manish Sinha <manish.sinha@intel.com>
Change-Id: I605e35b1a101d92735e6b5465b24291f382f11a8

10 years agoMerge "resetting manifest requested domain to floor" into tizen
Ryan Ware [Mon, 8 Jul 2013 16:37:04 +0000 (09:37 -0700)]
Merge "resetting manifest requested domain to floor" into tizen

10 years agoresetting manifest requested domain to floor
Alexandru Cornea [Mon, 1 Jul 2013 18:36:12 +0000 (21:36 +0300)]
resetting manifest requested domain to floor

10 years agoDo not use compression flag when performing rsync
Michael I Doherty [Mon, 1 Jul 2013 14:04:23 +0000 (15:04 +0100)]
Do not use compression flag when performing rsync

10 years agochangelog
William Douglas [Tue, 25 Jun 2013 16:48:33 +0000 (09:48 -0700)]
changelog

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoCreate an initial factory default snapshot
William Douglas [Fri, 21 Jun 2013 19:08:18 +0000 (12:08 -0700)]
Create an initial factory default snapshot

Add an inital snapshot after files have been installed to the target
device using snapper.

Change-Id: I452818b88c4cb174e65ff4110e707e7ed80a929c
Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoEnsure that the boot and shutdown are quiet by using splash=silent
Michael I Doherty [Wed, 19 Jun 2013 14:48:48 +0000 (15:48 +0100)]
Ensure that the boot and shutdown are quiet by using splash=silent

10 years agochangelog
William Douglas [Tue, 18 Jun 2013 21:41:10 +0000 (14:41 -0700)]
changelog

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoFix typo
William Douglas [Thu, 6 Jun 2013 19:21:07 +0000 (12:21 -0700)]
Fix typo

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoUse the swap partition.
William Douglas [Fri, 31 May 2013 19:43:34 +0000 (12:43 -0700)]
Use the swap partition.

While we were creating a partition to be used for swap, it was not
actually getting formatted or mounted.

Also since we are using swap for hibernate make sure to add resume
from the swap partition to the syslinux config file.

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agochangelog
William Douglas [Tue, 14 May 2013 23:07:31 +0000 (16:07 -0700)]
changelog

Signed-off-by: William Douglas <william.douglas@intel.com>
10 years agoUpdate the plymouth theme after install
William Douglas [Tue, 14 May 2013 21:21:36 +0000 (14:21 -0700)]
Update the plymouth theme after install

Once Tizen has been installed change the plymouth theme to be the
boot and update version.

Signed-off-by: William Douglas <william.douglas@intel.com>
11 years agoRemove old snapshots subvolume creation.
William Douglas [Mon, 15 Apr 2013 22:12:15 +0000 (15:12 -0700)]
Remove old snapshots subvolume creation.

Also reword the instructions for rebooting after install.

Signed-off-by: William Douglas <william.douglas@intel.com>
11 years agoMerge "Update snapshots location for snapper"
Nashif, Anas [Fri, 12 Apr 2013 09:10:11 +0000 (02:10 -0700)]
Merge "Update snapshots location for snapper"

11 years agoUpdate snapshots location for snapper
William Douglas [Wed, 10 Apr 2013 13:41:26 +0000 (06:41 -0700)]
Update snapshots location for snapper

Signed-off-by: William Douglas <william.douglas@intel.com>
11 years agoupdate snapshots location for snapper
William Douglas [Wed, 10 Apr 2013 13:41:26 +0000 (06:41 -0700)]
update snapshots location for snapper

Signed-off-by: William Douglas <william.douglas@intel.com>
11 years agoDepend on the new btrfs-progs instead
Patrick McCarty [Wed, 6 Mar 2013 22:33:19 +0000 (14:33 -0800)]
Depend on the new btrfs-progs instead

Change-Id: If721abf35a0f9e6c97cc64a5047fb817a647d4c5

11 years agoCreate btrfs filesystem on install
William Douglas [Thu, 21 Feb 2013 20:22:57 +0000 (12:22 -0800)]
Create btrfs filesystem on install

Have the rootfs be created as a btrfs partition. Also create two
subvolumes, one to host the tizen install and one to host the tizen
subvolume snapshots. The installer will set the tizen subvolume as
the default subvolume and take a snapshot of it after install.

Oh and fix reboot not working right.

Signed-off-by: William Douglas <william.douglas@intel.com>
11 years agoReboot at end of installation process
Anas Nashif [Wed, 20 Feb 2013 02:26:47 +0000 (18:26 -0800)]
Reboot at end of installation process

11 years agoreboot when rR are pressed
Anas Nashif [Wed, 20 Feb 2013 02:26:19 +0000 (18:26 -0800)]
reboot when rR are pressed

11 years agoDo not use initrd on installed system
Anas Nashif [Wed, 20 Feb 2013 02:23:21 +0000 (18:23 -0800)]
Do not use initrd on installed system

11 years agoNo need for initrd when installed
Anas Nashif [Wed, 20 Feb 2013 02:22:58 +0000 (18:22 -0800)]
No need for initrd when installed

11 years agoUpdate default kernel boot path.
William Douglas [Thu, 31 Jan 2013 22:53:57 +0000 (14:53 -0800)]
Update default kernel boot path.

We create a symlink from our default kernel to /boot/vmlinuz so use that
as the kernel boot target.

Signed-off-by: William Douglas <william.douglas@intel.com>
11 years agofixed plymouth messages
Anas Nashif [Wed, 19 Dec 2012 18:49:04 +0000 (10:49 -0800)]
fixed plymouth messages

11 years agofixed plymouth messages
Anas Nashif [Wed, 19 Dec 2012 18:48:46 +0000 (10:48 -0800)]
fixed plymouth messages

11 years agoadd changelog
Anas Nashif [Wed, 19 Dec 2012 17:57:56 +0000 (09:57 -0800)]
add changelog

11 years agoadd requirements
Anas Nashif [Wed, 19 Dec 2012 17:31:30 +0000 (09:31 -0800)]
add requirements

11 years agoadd requirements
Anas Nashif [Wed, 19 Dec 2012 17:31:16 +0000 (09:31 -0800)]
add requirements

11 years agoadd plymouth message
Anas Nashif [Wed, 19 Dec 2012 17:30:24 +0000 (09:30 -0800)]
add plymouth message

11 years agoadd plymouth message
Anas Nashif [Wed, 19 Dec 2012 17:29:08 +0000 (09:29 -0800)]
add plymouth message

11 years agofixed shell call
Anas Nashif [Wed, 19 Dec 2012 16:16:00 +0000 (08:16 -0800)]
fixed shell call

11 years agofixed menu
Anas Nashif [Wed, 19 Dec 2012 15:52:23 +0000 (07:52 -0800)]
fixed menu

11 years agoadd packaging
Anas Nashif [Wed, 19 Dec 2012 14:45:30 +0000 (06:45 -0800)]
add packaging

11 years agoadd packaging
Anas Nashif [Wed, 19 Dec 2012 14:44:48 +0000 (06:44 -0800)]
add packaging

11 years agoadd packaging
Anas Nashif [Wed, 19 Dec 2012 14:42:37 +0000 (06:42 -0800)]
add packaging

11 years agoadd packaging
Anas Nashif [Wed, 19 Dec 2012 14:24:31 +0000 (06:24 -0800)]
add packaging

11 years agoadd packaging
Anas Nashif [Wed, 19 Dec 2012 14:22:39 +0000 (06:22 -0800)]
add packaging

11 years agoinitial
Anas Nashif [Sat, 24 Nov 2012 05:18:15 +0000 (21:18 -0800)]
initial