~canonical-kernel/+git/kteam-tools:wenchien/cranky

Last commit made on 2024-01-09
Get this branch:
git clone -b wenchien/cranky https://git.launchpad.net/~canonical-kernel/+git/kteam-tools
Members of Canonical Kernel can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
wenchien/cranky
Repository:
lp:~canonical-kernel/+git/kteam-tools

Recent commits

0e517a2... by Jesse Sung

cranky/startnewrelease: Check before using DEBIAN_MASTER as a directory

In uc20/uc22 packages, although $DEBIAN_MASTER is not empty, we don't
have that directory availiable. Check if the directory really exists
before using it.

Signed-off-by: Wen-chien Jesse Sung <email address hidden>

177258a... by Juerg Haefliger

nwager/cleanup-chroot: remove unused sources/configs session split

## Description

Jira: https://warthogs.atlassian.net/browse/KERNTT-724

Originally, chroot sessions were either `sources` or `configs` in case they needed different sessions, but that has not turned out to be true. Remove the distinction in favor of a single session per series.

Additionally, add the option to specify a user when using `cranky chroot run`, so one can e.g. run as root to install additional packages. Also did some very minor style cleanup.

All `sources|configs` references have been updated in kteam-tools, but read-the-docs still needs to be updated.

## Migrating to the new naming system

Here is a command to remove all the old `sources|configs` sessions. You will need to `cranky chroot create-session <handle>` again.
```bash
for s in $(schroot -l --all-sessions | grep -Po "(?<=session:)cranky-.+-(sources|configs)$"); do schroot -e -c $s; done
```

You can also use this script to automatically remove and recreate the sessions.
```bash
#!/bin/bash

set -e

# get all sessions with the old naming scheme
OLD_SESSIONS=( $(schroot -l --all-sessions | grep -Po "(?<=session:)cranky-.+-(sources|configs)$") )
# get the handles from the old sessions to recreate them
OLD_HANDLES=( $(printf '%s\n' "${OLD_SESSIONS[@]}" | sed -E 's/cranky-(.+)-([a-z0-9]+)-(sources|configs)/\1:linux/') )

for (( i=0; i < ${#OLD_SESSIONS[@]}; ++i )); do
    echo "Removing old session ${OLD_SESSIONS[i]}..."
    schroot -e -c ${OLD_SESSIONS[i]}
    echo "Recreating session for ${OLD_HANDLES[i]}..."
    cranky chroot create-session ${OLD_HANDLES[i]}
done
```

Acked-by: Juerg Haefliger <email address hidden>
Signed-off-by: Juerg Haefliger <email address hidden>

dd1974c... by Juerg Haefliger

cranky: chroot: make it backwards compatible

Make cranky chroot backwards compatible:
  1) If a new session is not found, try to find an old one and operate
     on that.
  2) Parse the old sources|configs commandline option (but ignore it).

Emit deprecation warnings for the above and add a deprecation notice to
the script usage.

https://warthogs.atlassian.net/browse/KERNTT-724
Signed-off-by: Juerg Haefliger <email address hidden>

fec4e9b... by Noah Wager

cranky: move builder-extra.asc to gpg.d dir

https://warthogs.atlassian.net/browse/KERNTT-724
Signed-off-by: Noah Wager <email address hidden>
[juergh: Update cranky/cmds.d/chroot accordingly.]
Signed-off-by: Juerg Haefliger <email address hidden>

a96f40b... by Noah Wager

cranky: chroot: add which handling

Users can specify chroot session names (appended to the normal chroot
prefixes) using the --which option, like the old <sources|configs>. If
left out, it will create a default session.

The kernel series can be specified with: only the series, the handle,
or a path. If the series is omitted, it tries to infer the series from
the current directory.

Some help messages have been updated accordingly.

https://warthogs.atlassian.net/browse/KERNTT-724
Signed-off-by: Noah Wager <email address hidden>
[juergh: Limited the commit to adding --which commandline argument,
 trimmed the commit message.]
Signed-off-by: Juerg Haefliger <email address hidden>

fa4925c... by Noah Wager

cranky: chroot: accept either a series or a full handle

Add the option to pass a series by itself, which will default to
SERIES:linux, or pass a full handle as usual.

Also made some small formatting changes, like indenting case statements,
making the fallthrough case more readable, and other small changes.

https://warthogs.atlassian.net/browse/KERNTT-724
Signed-off-by: Noah Wager <email address hidden>
[juergh: Don't use distro-info (might not be up-to-date).]
Signed-off-by: Juerg Haefliger <email address hidden>

8cbaa86... by Noah Wager

cranky: chroot: add option to run as different user

`cranky chroot run <handle> -u <user> -- <cmd>` will run the commands in
the chroot as the specified user. This is helpful if e.g. you want to
run as root to add packages.

https://warthogs.atlassian.net/browse/KERNTT-724
Signed-off-by: Noah Wager <email address hidden>
[juergh: Fix argument order, use $USER, add --user long option.]
Signed-off-by: Juerg Haefliger <email address hidden>

3b4be3c... by Noah Wager

cranky: chroot: remove unused sources/configs session separation

From Juerg Haefliger: cranky chroot splits `sources` and `configs` session
types in case the sessions have differences, but this is not the case.
Remove the separation in favor of a single session per series.

https://warthogs.atlassian.net/browse/KERNTT-724
Signed-off-by: Noah Wager <email address hidden>

bd8fecc... by Andrea Righi

chroot-setup: add Rust build-depends for noble (6.7)

Signed-off-by: Andrea Righi <email address hidden>
Acked-by: Roxana Nicolescu <email address hidden>
Signed-off-by: Andrea Righi <email address hidden>

014cca4... by Andrea Righi

chroot-setup: add Rust build-depends for noble (6.7)

Signed-off-by: Andrea Righi <email address hidden>