NiChrome icon indicating copy to clipboard operation
NiChrome copied to clipboard

[Proposal] Move cloned dependencies to temporary directories

Open erfanian opened this issue 7 years ago • 3 comments

Currently we fetch the following assets when running usb.go:

  • The Linux Kernel
  • Linux Firmware
  • Vboot
  • Chrome

I propose that we move cloning these resources to the os.TempDir. Build artifacts that are required for successful execution will be copied to a new stable directory in os.TempDir.

usb would lose support for the following flags:

  • fetch
  • skiproot
  • skipkern
  • keys

Instead, the utility would gain support for one new flag, which would indicate that it should attempt to retrieve all dependencies and recreate any build artifacts. The utility would now check for the presence of the build artifacts in the os.TempDir, and if they were not found, would again attempt to retrieve and recreate all of the build artifacts.

This would have to be done in a way that would still support the static and dynamic build modes.

This may result in more time spent compiling if users reboot frequently.

erfanian avatar Mar 06 '18 17:03 erfanian

how about a tmp/ in a persistent place. I don't want to refetch all this stuff very time I reboot. also, skiproot and skipkern are extremely useful, since I frequently want to test a new kern with an old initramfs, for example. I'd rather not lose these.

These flags seem hacky but if you spend enough time building images they are timesavers. I think this proposal could use some tuning.

rminnich avatar Mar 06 '18 17:03 rminnich

How frequently do you reboot? The cloning should only take a few minutes.

Perhaps it would make more sense to expose the specific kernel tag you'd like to experiment with as a flag?

erfanian avatar Mar 06 '18 18:03 erfanian

It could be like a local vendor directory, in your repo.

./nvendor/kernel ./nvendor/chromium

If you want to redownload your kernel, blow away nvendor/kernel.

hugelgupf avatar Mar 06 '18 18:03 hugelgupf