Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to be able to build and deploy lomiri-system-settings #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

uxes
Copy link
Contributor

@uxes uxes commented Aug 31, 2024

  1. fixing warning --force-yes is deprecated, use one of the options starting with --allow instead

  2. when building lomiri-system-settings and deploing locally, apt is ignoring the local version (e.g. 1.0.2+1local~1725113893) and wanting the repository version (e.g. 1.0.2+0~20240710053303.1+ubports20.04~1.gbp001aac) this change is forcing the local version https://forums.ubports.com/topic/9536/error-while-installing-lomiri-systems-settings
    fixed just with -f

  3. resolved umounting manually sudo umount /usr/share/session-migration/scripts

uxes and others added 2 commits August 31, 2024 20:32
1. fixing error `--force-yes is deprecated, use one of the options starting with --allow instead`

2. when building lomiri-system-settings and deploing locally, apt is ignoring the local version (e.g. 1.0.2+1local~1725113893) and wanting the repository version (e.g. 1.0.2+0~20240710053303.1+ubports20.04~1.gbp001aac) this change is forcing the local version  https://forums.ubports.com/topic/9536/error-while-installing-lomiri-systems-settings
resolves issue
dpkg: error processing archive /tmp/repo//lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb (--unpack):
 unable to create '/usr/share/session-migration/scripts/lomiri-system-settings-datahome-migration.sh.dpkg-new' (while processing './usr/share/session-migration/scripts/lomiri-system-settings-datahome-migration.sh'): Read-only file system
dpkg: error while cleaning up:
 unable to remove newly-extracted version of '/usr/share/session-migration/scripts/lomiri-system-settings-datahome-migration.sh': Read-only file system
@uxes
Copy link
Contributor Author

uxes commented Aug 31, 2024

uxes@cinkpadT14 ~/code/ubports/lomiri-system-settings (git)-[ubports/focal] % crossbuilder [email protected] --password=xxxx deploy
Transferring Debian packages to device.
debs_1.0.2+1local~1725131539.tar                                        100%   14MB   1.5MB/s   00:09    
liblomirisystemsettings-dev_1.0.2+1local~1725131539_arm64.deb
liblomirisystemsettings1_1.0.2+1local~1725131539_arm64.deb
liblomirisystemsettingsprivate-dev_1.0.2+1local~1725131539_arm64.deb
liblomirisystemsettingsprivate0_1.0.2+1local~1725131539_arm64.deb
lomiri-system-settings-autopilot_1.0.2+1local~1725131539_all.deb
lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb
Upgrading packages already installed on device with newly built ones.
create_repository.sh                                                    100% 1385   382.4KB/s   00:00    
+ where=/tmp/repo
+ origin=local
+ label=repo
+ cd /tmp/repo
+ apt-ftparchive sources .
+ tee /tmp/repo/Sources
+ gzip -9
+ apt-ftparchive packages /tmp/repo
+ sed s@/tmp/repo@@
+ gzip -9
+ tee /tmp/repo/Packages
+ apt-ftparchive -oAPT::FTPArchive::Release::Origin=local -oAPT::FTPArchive::Release::Label=repo -oAPT::FTPArchive::Release::Codename=/tmp/repo release /tmp/repo
Package: *
Pin: release o=local
Pin-Priority: 2000

Package: *
Pin: release a=focal*
Pin-Priority: 50sed: can't read /etc/apt/preferences.d/extra-ppas.pref: No such file or directory
Get:1 file:/tmp/repo  InRelease
Ign:1 file:/tmp/repo  InRelease
Get:2 file:/tmp/repo  Release [2,006 B]
Get:2 file:/tmp/repo  Release [2,006 B]
Get:3 file:/tmp/repo  Release.gpg
Ign:3 file:/tmp/repo  Release.gpg
Get:4 file:/tmp/repo  Packages [2,628 B]
Reading package lists...
W: No sandbox user '_apt' on the system, can not drop privileges
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  liblomirisystemsettings1 liblomirisystemsettingsprivate0
  lomiri-system-settings
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/12.0 MB of archives.
After this operation, 55.6 MB of additional disk space will be used.
Get:1 file:/tmp/repo  liblomirisystemsettingsprivate0 1.0.2+1local~1725131539 [619 kB]
Get:2 file:/tmp/repo  lomiri-system-settings 1.0.2+1local~1725131539 [11.1 MB]
Get:3 file:/tmp/repo  liblomirisystemsettings1 1.0.2+1local~1725131539 [261 kB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
(Reading database ... 58886 files and directories currently installed.)
Preparing to unpack .../liblomirisystemsettingsprivate0_1.0.2+1local~1725131539_arm64.deb ...
Unpacking liblomirisystemsettingsprivate0:arm64 (1.0.2+1local~1725131539) over (1.0.2+0~20240710053303.1+ubports20.04~1.gbp001aac) ...
Preparing to unpack .../lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb ...
Unpacking lomiri-system-settings (1.0.2+1local~1725131539) over (1.0.2+0~20240710053303.1+ubports20.04~1.gbp001aac) ...
dpkg: error processing archive /tmp/repo//lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb (--unpack):
 unable to create '/usr/share/session-migration/scripts/lomiri-system-settings-datahome-migration.sh.dpkg-new' (while processing './usr/share/session-migration/scripts/lomiri-system-settings-datahome-migration.sh'): Read-only file system
dpkg: error while cleaning up:
 unable to remove newly-extracted version of '/usr/share/session-migration/scripts/lomiri-system-settings-datahome-migration.sh': Read-only file system
Preparing to unpack .../liblomirisystemsettings1_1.0.2+1local~1725131539_arm64.deb ...
Unpacking liblomirisystemsettings1:arm64 (1.0.2+1local~1725131539) over (1.0.2+0~20240710053303.1+ubports20.04~1.gbp001aac) ...
Errors were encountered while processing:
 /tmp/repo//lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb
W: No sandbox user '_apt' on the system, can not drop privileges
E: Sub-process /usr/bin/dpkg returned an error code (1)
sed: can't read /etc/apt/preferences.d/extra-ppas.pref: No such file or directory
If a script named .crossbuilder/post_deploy existed, it would be executed on device after every deploy.

result after this patch

crossbuilder [email protected] --password=xxxx deploy
debs_1.0.2+1local~1725131539.tar                                        100%   14MB   1.4MB/s   00:09    
liblomirisystemsettings-dev_1.0.2+1local~1725131539_arm64.deb
liblomirisystemsettings1_1.0.2+1local~1725131539_arm64.deb
liblomirisystemsettingsprivate-dev_1.0.2+1local~1725131539_arm64.deb
liblomirisystemsettingsprivate0_1.0.2+1local~1725131539_arm64.deb
lomiri-system-settings-autopilot_1.0.2+1local~1725131539_all.deb
lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb
Upgrading packages already installed on device with newly built ones.
+ where=/tmp/repo
+ origin=local
+ label=repo
+ cd /tmp/repo
+ apt-ftparchive sources .
+ tee /tmp/repo/Sources
+ gzip -9
+ sed s@/tmp/repo@@
+ tee /tmp/repo/Packages
+ apt-ftparchive packages /tmp/repo
+ gzip -9
+ apt-ftparchive -oAPT::FTPArchive::Release::Origin=local -oAPT::FTPArchive::Release::Label=repo -oAPT::FTPArchive::Release::Codename=/tmp/repo release /tmp/repo
sed: can't read /etc/apt/preferences.d/extra-ppas.pref: No such file or directory
Get:1 file:/tmp/repo  InRelease
Ign:1 file:/tmp/repo  InRelease
Get:2 file:/tmp/repo  Release [2,006 B]
Get:2 file:/tmp/repo  Release [2,006 B]
Get:3 file:/tmp/repo  Release.gpg
Ign:3 file:/tmp/repo  Release.gpg
Reading package lists...
W: No sandbox user '_apt' on the system, can not drop privileges
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  lomiri-system-settings
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/11.1 MB of archives.
After this operation, 52.2 MB of additional disk space will be used.
Get:1 file:/tmp/repo  lomiri-system-settings 1.0.2+1local~1725131539 [11.1 MB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
(Reading database ... 58886 files and directories currently installed.)
Preparing to unpack .../lomiri-system-settings_1.0.2+1local~1725131539_arm64.deb ...
Unpacking lomiri-system-settings (1.0.2+1local~1725131539) over (1.0.2+0~20240710053303.1+ubports20.04~1.gbp001aac) ...
Setting up liblomirisystemsettingsprivate0:arm64 (1.0.2+1local~1725131539) ...
Setting up liblomirisystemsettings1:arm64 (1.0.2+1local~1725131539) ...
Setting up lomiri-system-settings (1.0.2+1local~1725131539) ...
Processing triggers for libglib2.0-0:arm64 (2.64.6-1~ubuntu20.04.7) ...
Processing triggers for libc-bin (2.31-0ubuntu9.16) ...
Processing triggers for mime-support (3.64ubuntu1) ...
W: No sandbox user '_apt' on the system, can not drop privileges
sed: can't read /etc/apt/preferences.d/extra-ppas.pref: No such file or directory
If a script named .crossbuilder/post_deploy existed, it would be executed on device after every deploy.

@uxes uxes changed the title Allow forcing packages from current build Changes to be able to build and deploy lomiri-system-settings Aug 31, 2024
@@ -886,8 +886,9 @@ deploy_deb () {
fi;

device exec "SUDO_ASKPASS=/tmp/askpass.sh sudo -A sed -i '/Pin-Priority/c\Pin-Priority: 50' /etc/apt/preferences.d/extra-ppas.pref"
device exec SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get update -o Dir::Etc::sourcelist="/tmp/repo/sources.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
device exec SUDO_ASKPASS=/tmp/askpass.sh sudo -A apt-get dist-upgrade -o Dir::Etc::sourcelist="/tmp/repo/all.list" --yes --force-yes
device exec SUDO_ASKPASS=/tmp/askpass.sh sudo -A umount /usr/share/session-migration/scripts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... the path(s) to unmount will vary from device to device and from package to package. Not every device will have /usr/share/session-migration/scripts as a bind-mount. Hard-coding this here isn't particularly a good solution.

I don't have a good solution for this yet, so for now you'll have to manually run umount command as it dpkg complains. We probably should document this somewhere though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants