Commit Graph

36 Commits

Author SHA1 Message Date
Attila Szöllősi c6fe6e134a Flavor instead of device name when creating recovery zip (#491)
* Flavor instead of device name when creating recovery zip.
* Move parse_flavor_arg function
2017-09-02 03:53:58 +00:00
Oliver Smith db6491c679 Fix #475: Retry finding the install partitions (#479) 2017-08-30 18:58:51 +00:00
Oliver Smith c33db6315e Fix #463: Ignore exit code from parted (#465)
Parted often succeeds, but then returns a non-zero exit code, because
it can not inform the kernel of the changes.
In most cases this is not even necessary, so it really should not
fail there.
When the error was fatal, pmbootstrap will crash shortly afterwards
when it tried to mount or run mkfs on the partition anyway.
2017-08-25 17:39:52 +00:00
Attila Szöllősi fbe968f1ab Recovery installer zip (#404)
Supports flashing with TWRP and other Android recovery OS through adb sideload,
as well as exporting a generated recovery zip file.
See also:
https://github.com/postmarketOS/pmbootstrap/wiki/deviceinfo_flash_methods#recovery-mode-adb
2017-08-24 21:07:36 +00:00
Pablo Castellano 3954883547 Write custom os-release (closes #324) (#439)
* Write custom os-release (closes #324)
* Return empty string instead of crashing when the directory is not a git repository
* Use https in homepage URL
2017-08-23 16:40:16 +00:00
Martijn Braam c536e4ea58 Add setting for device keymap for devices with keymaps (#379)
* Added rx51_us keymap to nokia n900
* Added keymap option to init
* Made install command run setup-keymap when neccesary
* Validate keymap on install
2017-08-19 21:40:20 +00:00
Oliver Smith 1c13ca4fd9 Fix #363: Omit /home/user when calculating system image size (#389)
* The system image size is now calculated as: root size - home size.
* New function in `pmb/helpers/other.py`: `folder_size()`, with a
  testcase.
* Instead of copying everything to the system image folder, and
  deleting the home folder afterwards, do not copy the home folder
  in the first place.
* Added `pmbootstrap -s` to skip generating the initramfs for faster
  debugging.
* Set the default value in the "are you sure, that your partition has
  at least..." to "y", so we can run `yes '' | pmbootstrap install`
  to make it run through the whole installation process.
* Increase full size to 120%, boot partition gets 15 MB free space now
2017-08-18 19:19:48 +00:00
clayton craft 5144323137 Allow users to copy ssh pubkey to device (#387) 2017-08-16 17:30:38 +00:00
clayton craft 3800cd09f4 Do not modprobe loop if /dev/loop* exists (#391) 2017-08-15 18:10:04 +00:00
drebrez 96cb52847d Increase minimal system image size by 15% to have some free space (#336) 2017-08-09 19:16:04 +00:00
drebrez 147863d98a Automatically compute the minimum size for the partition and resize it during the boot process (#127)
* Automatically compute the minimum size for the partitions
* Automatically resize the pmOS_root partition during the boot process
* Resize root partition only if there is unallocated space at the end of the device.
* Added more echos to make debugging easier while looking at the pmOS_init.log.
* Updated static_code_analysis.sh script to run shellcheck with `-x` option.
2017-08-03 16:01:00 +00:00
Pablo Castellano 0e4017105d Implement sparse system images (fix #299) (#303)
* Packaged libsparse

libsparse from the Android project provides multiple tools like img2simg
and simg2img.
These are used to split a large image for the system partition into
separate smaller chunks with sparse headers

This is required for several devices (at least bullhead, fp2 and titan)
because it fixes the "Invalid sparse file format at header magi" error

https://github.com/postmarketOS/pmbootstrap/issues/299

* Added new variable deviceinfo_flash_sparse (fixes #299)

Right after the system image is generated, pmbootstrap checks this
variable. In case it is true, run img2simg on it

* motorola-titan: enable deviceinfo_flash_sparse

* libsparse: use source from github: anestisb/android-simg2img

It is not that easy to use the upstream archive because everytime
you download it, the files have the current date as creation date
and that makes the file have a different checksum every download
https://github.com/postmarketOS/pmbootstrap/pull/303#issuecomment-319017197
2017-08-02 16:21:50 +00:00
Pablo Castellano 8389448bfd init: Allow to specify extra packages that will be always installed to rootfs (#304) 2017-08-01 15:31:33 +00:00
Oliver Smith 0ae6a150e8 Fix #269: Always use truncate to create empty image file (#276)
I've realized that truncate is provided by busybox anyway, so no
need to install coreutils for this.

This should fix creating system image files on ZFS, where fallocate
is not implemented.
2017-07-28 17:41:35 +00:00
Martijn Braam 3be2fce72f Merge pull request #267 from postmarketOS/fix/242-validate-input
Fix #242: Validate input in pmb.helpers.cli
2017-07-27 20:08:26 +02:00
Oliver Smith 6a034f1409 Various improvements for 'pmbootstrap export' (Fix #232) (#250)
* Various improvements for 'pmbootstrap export' (Fix #232)
* Do not try to generate the system image, but print a notice that
  it was not generated yet
* Display export path
* New default path: /tmp/postmarketOS-export (instead of current
  working dir)
* Create the export folder, if it does not exist yet
* Prettier output in the export message
* Adjust export message in install for consistency
2017-07-27 17:40:38 +00:00
Oliver Smith a49187c6e4
Fix #242: Validate input in pmb.helpers.cli
* Validate all inputs from `pmbootstrap init`
* Add a new `confirm()` function, that validates input of yes/no
  questions properly
* All questions loop until they have a valid answer now
2017-07-26 19:05:06 +02:00
clayton craft 924546135c De-couple weston from postmarketos-base (#233)
Thanks, craftyguy!

- UI is selectable with `pmbootstrap init`. Currently only 'weston' and 'none' are options. It'll automatically pick up any new `postmarketos-ui-*` packages added at later dates.
- splits off weston packages install from postmarketos-base and puts
them into postmarketos-ui-weston. Also note that NO weston packages are
installed by "pmbootstrap install" by default unless the user selects a ui in the `init`
- configuration of weston is now in postmarketos-ui-weston.
- the demos have been spun off to `postmarketos-demos`, and `postmarketos-ui-weston` lists this package as a dependency.
2017-07-24 20:55:55 +00:00
cmdr2 2afe205243 Ignore directories while searching for loop devices (#235)
Thanks, cmdr2! Here's the text from his PR:

Fixes an issue on alpine-vanilla, where `/dev/loop` is a directory (containing `/dev/loop/0`, `/dev/loop/1` ..etc), and causes `./pmbootstrap install` to fail.

Ignoring the `/dev/loop` directory works because `/dev/` also contains files named `/dev/loop0`, `/dev/loop1` ..etc, which the new code will still pick up.

The `install` command passes after this fix on my alpine-vanilla.
2017-07-23 12:24:56 +00:00
Oliver Smith 66cda810c1
Improve the FDE hint, you need to type in the password twice. 2017-07-22 12:49:43 +02:00
Oliver Smith 77d7ed1679
Close #215: Write explicity what passwords are for in install 2017-07-21 21:14:16 +02:00
Oliver Smith 5651c28b41
Fix #162: flash_system: meaningful error for missing image 2017-07-21 20:26:56 +02:00
Oliver Smith 615880e161
pmbootstrap flasher: use boot.img file with fastboot 2017-07-04 22:47:03 +02:00
Pablo Castellano ba744abae0 Show path to boot.img and description of commands after pmbootstrap install
This change got lost in this PR merge:
https://github.com/postmarketOS/pmbootstrap/pull/125
2017-07-03 23:49:05 +02:00
Oliver Smith 4573863561
Rename args.no_fde to args.full_disk_encryption 2017-06-28 17:22:48 +02:00
Pablo Castellano 920d4c8198 Mount unencrypted root partition (close #86)
- Do not decrypt if not necessary
- Do not launch telnetd if partition is unencrypted
- Basic initramfs logging to /tmp/boot.log
2017-06-22 20:14:38 +02:00
Pablo Castellano efab93e4d0 Use variable in format.py and add labels to partitions 2017-06-22 19:58:28 +02:00
Oliver Smith 6999e6ea47
Fix #40: allow sdcard install, when the sdcard is mounted as /dev/sd* 2017-06-10 00:29:48 +02:00
Oliver Smith 18339d0a14
Close #69: add 'pmbootstrap initfs' and improve initfs workflow
* allows to build/extract/list initramfs, add/del hook
* rebuild the initfs whenever running install or trying to flash/boot it
* flasher flash/boot: automatically set up a minimal rootfs with kernel and initfs,
  if it does not exist yet
2017-06-09 19:22:25 +02:00
Oliver Smith 32ad868cdc
apk.installed(): Retuns all packages and versions now
pmb.chroot.apk.installed() used to return only the explicitly installed
packages. This is not good enough for the initfs check functions (and
especially for the "lazy reproducible builds", from which branch this
commit was cherry picked).

This commit introduces more noise for the logfile - if this becomes
a problem, raise your voice in the issues tracker and we'll do something
about it.

(This commit also changes minor code styling in other files, I did
not run autopep8 last time, because flake8 didn't complain...)
2017-06-09 18:01:39 +02:00
Oliver Smith 9515782f8d
Fix 67: New '--add' parameter for 'pmbootstrap install' to add custom packages.
Example usage:

./pmbootstrap install --add='vim,gcc'
2017-06-08 18:10:00 +02:00
Oliver Smith f1ab344f09
Fix #68: properly update the device chroot in the install step
* build all dependencies, that have a newer version
* upgrade all packages inside the chroot
2017-06-08 17:54:53 +02:00
Oliver Smith 64521b1435
Make static code analysis go through again 2017-06-04 04:27:49 +02:00
Oliver Smith 9d4bc61545
Fix #47: Support /dev/sd* as sdcard device
* The check for valid sdcard paths has been removed (because it
  doesn't make sense for /dev/sd*, this might as well be a real
  harddrive)
* New check: abort if any partition of the sdcard is mounted
* Automatically detect if the partitions are called "p1", "p2" etc.
  or just "1", "2" etc. (/dev/sda1 vs. /dev/mmcblk0p1)
* pmb.helpers.mount.ismount(): check the source (new) and the target
  path in /proc/mounts
2017-06-04 02:57:37 +02:00
Oliver Smith 42a8990594
Fix #28: fall back to truncate, when fallocate does not work 2017-06-02 23:00:52 +02:00
Oliver Smith ae950fb9f7
Hello, there! 2017-05-26 22:08:45 +02:00