Skip to content
Snippets Groups Projects

Added --password option to install to aid in automation

Closed Imported Administrator requested to merge install-automation into master
1 unresolved thread

I am working on a CI script for testing pmos on hardware, specifically hammerhead for now.

Merge request reports

Approval is optional

Closed by AdministratorAdministrator 4 years ago (Sep 21, 2020 1:49pm UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Administrator mentioned in issue #1908 (closed) · Imported

    mentioned in issue #1908 (closed)

    By Oliver Smith on 2020-04-18T10:43:05

  • Author Owner

    Regarding --password, I don't think we should do it like that. Let's discuss in #1908 (closed). For your automated test, until this is resolved, I suggest that you use the patch for now from a separate branch.

    Also I'm wondering, why you are not using the good old yes | pmbootstrap install for your use case, do you need a numeric password and does this not work that way?

    Thanks for the merge request @unrznbl! and also for the cool automated hardware test you're working on, this looks like it could bring huge quality improvements. :thumbsup:

    By Oliver Smith on 2020-04-18T10:49:26

  • Author Owner

    @ollieparanoid my CI thing is just a bash script. Where should it live? Let me know and I'll make a WIP MR for that. I'm getting pretty close at this point but there is much to do. :) I am focusing on bring-up and ofono working with a cell network for now. Granted for me this works because I have a test 3g network and many SIMs. For others they would need a SIM for a commercial service provider, possible but a bit more challenging/resource intensive aka costs money. But at the least you can definitely test that the modem works, it can be powered on, enabled and contactable cells are present (list-providers in ofonoctl). So that's quite a bit actually.

    By Craig Comstock on 2020-04-18T12:27:01

  • Author Owner

    Where should it live?

    Can you put it in your own gitlab namespace somewhere for now? Then we see how it looks like and it's probably easier to decide where to put it.

    By Oliver Smith on 2020-04-19T17:13:05

  • Author Owner

    uploaded scripts that just worked for me on hammerhead with my branch of pmbootstrap that has --password argument.

    https://gitlab.com/unrznbl/postmarketos-hardware-ci

    By Craig Comstock on 2020-04-20T22:10:05

  • Author Owner

    Need to do some work on surnia, osprey and klte as those seem the most likely to succeed and get me near a working shelli UI and modem.

    By Craig Comstock on 2020-04-20T22:11:25

    • Author Owner

      Awesome work, @unrznbl!

      If you want to, we can set up a repo in the postmarketOS namespace for this, and get code review going etc.

      Some notes:

      • can you add a license, and related spdx lines?

      $PMB -y zap -hc -d -p -m -o -r

      Unless you are really concerned about disk space, $PMB -y zap -p -o should be enough here and cause less files to be downloaded, i.e. faster tests and less traffic wasted:

      • -hc deletes the http cache, which unnecessarily causes apk-tools-static to get downloaded again
      • -d causes source tarballs to be deleted
      • -m is covered by -p already, which deletes all locally compiled packages
      • -r is related to compiling rust packages. not really used now, as we don't have rust packages, but if we do in the future and you have to compile them because a binary package is missing, one would probably be glad that the sources are cached.

      Note that -o also takes some time, if you are not concerned about disk space I'd leave it out too. -p is the important one, it deletes locally compiled packages.

      $PMB install --password y

      This looks like yes | $PMB install would do the same :)

      By Oliver Smith on 2020-08-27T20:05:59

      Edited by Ghost User
    • Author Owner

      I will try these suggestions as I am about to go through a round of testing shelli-0.5 on harpia, hammerhead and klte.

      By Craig Comstock on 2020-08-27T20:05:59

    • Author Owner

      @ollieparanoid I think the reason I used --password instead of yes is that my script doesn't continue after the $PMB install step because I have set -e as I should.

      + yes
      + ../pmbootstrap/pmbootstrap.py install
      [09:03:27] *** (1/5) PREPARE NATIVE CHROOT ***
      [09:03:28] (native) install alpine-base
      [09:03:30] (native) install cryptsetup util-linux e2fsprogs parted dosfstools
      [09:03:31] *** (2/5) CREATE DEVICE ROOTFS ("lg-hammerhead") ***
      [09:03:32] (native) install qemu-arm
      [09:03:32] Register qemu binfmt (arm)
      [09:03:32] (rootfs_lg-hammerhead) install alpine-base
      [09:03:37] (rootfs_lg-hammerhead) install postmarketos-base device-lg-hammerhead device-lg-hammerhead-nonfree-firmware postmarketos-ui-shelli ed tmux neofetch
      ofonoctl evtest
      [09:04:53] (rootfs_lg-hammerhead) write /etc/os-release
      [09:04:53] (rootfs_lg-hammerhead) mkinitfs postmarketos-qcom-msm8974
      [09:05:43]  *** SET LOGIN PASSWORD FOR: 'user' ***
      New password: Retype new password: passwd: password updated successfully
      [09:05:43] NOTE: No valid keymap specified for device
      [09:05:47] *** (3/5) PREPARE INSTALL BLOCKDEVICE ***
      [09:05:47] (native) create lg-hammerhead.img (665M)
      [09:05:47] (native) mount /dev/install (lg-hammerhead.img)
      [09:05:48] (native) partition /dev/install (boot: 128M, reserved: 0M, root: the rest)
      [09:05:49] (native) format /dev/installp2
      [09:05:49] (native) mount /dev/installp2 to /mnt/install
      [09:05:49] (native) format /dev/installp1 (boot, ext2), mount to /mnt/install/boot
      [09:05:50] *** (4/5) FILL INSTALL BLOCKDEVICE ***
      [09:05:50] (native) copy rootfs_lg-hammerhead to /mnt/install/
      [09:06:00] *** (5/5) FLASHING TO DEVICE ***
      [09:06:00] Run the following to flash your installation to the target device:
      [09:06:00] * pmbootstrap flasher flash_rootfs
      [09:06:00]   Flashes the generated rootfs image to your device:
      [09:06:00]   /home/craig/.local/var/pmbootstrap/chroot_native/home/pmos/rootfs/lg-hammerhead.img
      [09:06:00]   (NOTE: This file has a partition table, which contains /boot and / subpartitions. That way we don't need to change the partition layout on your device.)
      [09:06:00] * pmbootstrap flasher flash_kernel
      [09:06:00]   Flashes the kernel + initramfs to your device:
      [09:06:00]   /home/craig/.local/var/pmbootstrap/chroot_rootfs_lg-hammerhead/boot
      [09:06:00]   (NOTE: fastboot also supports booting the kernel/initramfs directly without flashing. Use 'pmbootstrap flasher boot' to do that.)
      [09:06:00] * If the above steps do not work, you can also create symlinks to the generated files with 'pmbootstrap export' and flash outside of pmbootstrap.
      [09:06:00] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
      [09:06:00] Done
      craig@x220:~/src/postmarketos/postmarketos-hardware-ci$ echo $?
      141

      I can't quite figure out why I get that error code yet. I tried manually and get 0 every time.

      So I think yes might work if pmbootstrap.py install returned 0. That might be the bugfix I'm looking for (and will see if I can fix).

      So in summary, I agree with leaving this MR closed and the other issue closed and will continue to develop my CI process and eventually post up to a repo in postmarketOS.

      By Craig Comstock on 2020-09-22T14:20:14

    • Author Owner

      Huh, the 141 exit code is weird, haven't seen that before. It should exit with 0.

      So in summary, I agree with leaving this MR closed and the other issue closed and will continue to develop my CI process and eventually post up to a repo in postmarketOS.

      :thumbsup:

      By Oliver Smith on 2020-09-23T09:54:22

    • Please register or sign in to reply
  • Author Owner

    Is this MR still relevant given that #1908 (closed) is closed now?

    By Alexey Min on 2020-09-18T02:10:50

  • Administrator closed · Imported

    closed

  • Administrator mentioned in merge request !2125 (merged) · Imported

    mentioned in merge request !2125 (merged)

    By Caleb Connolly on 2021-10-10T22:00:32

Please register or sign in to reply
Loading