Ticket #834 (committed new feature)

Opened 2 years ago

Last modified 23 months ago

Building of rootfs doesn't work with file:// repositories

Reported by: jekhor Owned by: EvanKroske
Priority: normal Milestone: 0.3
Component: buildsystem Version: post-0.2 snapshot
Keywords: Cc:
Blocked By: Blocking:

Description

We need to mount  file:// repositories into chroot, probably.

Attachments

enter.patch Download (1.7 KB) - added by EvanKroske 23 months ago.
Simple patch for accessing exterior local repos from chroot dev environment.
enter.2.patch Download (2.3 KB) - added by EvanKroske 23 months ago.
Final patch for the enter script. Cleans up mounted local repos if script is interrupted.
cross-shell.patch Download (652 bytes) - added by EvanKroske 23 months ago.
cross-shell now mounts local repositories mentioned in the sources.list file of the target fs (the e-reader).
shared-mounts.patch Download (2.1 KB) - added by EvanKroske 23 months ago.
Added functions for mounting and unmounting repositories.

Change History

comment:1 Changed 23 months ago by dottedmag

Build environment is able to use http://, ftp:// and other networked repositories to fetch the following packages:

  • cross-compilation packages for build environment itself
  • target packages for creating rootfs

Using file:// repositories does not work though, as those repositories are not propagated from outside to chroot and further to inner chroot. This could be fixed by proper mount --binding in enter script and cross-shell.

comment:2 Changed 23 months ago by dottedmag

  • Type changed from bug to new feature

comment:3 Changed 23 months ago by EvanKroske

  • Owner changed from dottedmag to EvanKroske

Changed 23 months ago by EvanKroske

Simple patch for accessing exterior local repos from chroot dev environment.

comment:4 Changed 23 months ago by EvanKroske

I wrote a simple patch to access local repositories in the main environment from the chroot development environment. It cleans up after itself if the chroot dev environment is exited properly, but it leaves mounted directories if the shell window is closed. I'm working on a more robust version now. Are there any obvious bugs in my patch?

comment:5 Changed 23 months ago by dottedmag

Nice one, clean and simple.

  • I'd change removing empty directories to rmdir "$dir" 2>/dev/null || : to avoid relying on ls.
  • To make sure everything is cleaned up use trap and handle SIGHUP, SIGTERM etc.
  • Add some kind of locking, so subsequent calls won't mount the repositories twice. It is ok to have a racy locking (just test && touch) in this case, as enter is expected to be used interactively.

A bit of nitpicking:

  • Please don't quote paths without spaces inside, like "/etc/mtab"
  • if foo; then style is a bit more compact
  • Variables should be c_sty_le, not camel cased.

Changed 23 months ago by EvanKroske

Final patch for the enter script. Cleans up mounted local repos if script is interrupted.

comment:6 Changed 23 months ago by EvanKroske

The new patch cleans up the local repositories if the script is exited or user-interrupted (Ctrl + C), but it can't cope if the terminal window is closed or killed. I don't think the KILL signal can be caught by a bash script. This patch also complies with the style guidelines mentioned above.

Changed 23 months ago by EvanKroske

cross-shell now mounts local repositories mentioned in the sources.list file of the target fs (the e-reader).

Changed 23 months ago by EvanKroske

Added functions for mounting and unmounting repositories.

comment:7 Changed 23 months ago by EvanKroske

  • Status changed from new to committed
  • Milestone changed from bluesky to 0.3
Note: See TracTickets for help on using tickets.