Score:0

subiquity mount second media in early commands

gb flag

I am recreating the squashfs image (Ubuntu Focal) and putting the autoinstall answers inside the /etc/cloud/cloud.cfg.d/90_autoinstall.cfg file of the squashed filesystem. I've got everything working fine so far.

Now I would like to mount a second USB drive at already the early stage, something like this:

early-commands:
    - mkdir -p /target/media/gse-archive
    - mount /dev/disk/by-label/U20ARCHIVE /target/media/gse-archive

But compared to the late-commands there is nothing like /target. So I wonder if this could be achieved somehow?

The final goal, is to put the whole Ubuntu Focal archive onto this USB drive, set the sources.list right and perform a local dist-upgrade.

Thx

muru avatar
us flag
Why does it need to be done so early? Going by the goal, shouldn't it be fine as a `late-command`?
tombert avatar
gb flag
Because the "packages" command is being executed before the late-commands.
Score:0
gb flag

The answer was pretty much straight forward.

In the early commands section:

  early-commands:
    - mkdir -p /media/gse-archive
    - mount -o rw,async,nodiratime $(readlink -f /dev/disk/by-label/U20ARCHIVE) /media/gse-archive

And if it is needed in the target:

  late-commands:
    - mount --rbind /media /target/media
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.