Skip to content

Commit

Permalink
core-initrd: fix spelling and shellcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsosanchezbeato committed Dec 13, 2024
1 parent 706c8cc commit c57a5f8
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion core-initrd/24.04/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Depends: ${python3:Depends}, ${misc:Depends}, dracut-core (>= 051-1),
util-linux
Description: standard embedded initrd
Standard embedded initrd implementation to be used with Ubuntu Core
systems. Currently targetting creating BLS Type2 like binaries.
systems. Currently targeting creating BLS Type2 like binaries.
2 changes: 1 addition & 1 deletion core-initrd/24.04/debian/generate-x86-microcode
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
# Generates a copy of the minimal microcode for all AMD processors
# and installs it to the early initramfs

EFWE=$(realpath $1)
EFWE=$(realpath "$1")
EFWD=$(mktemp -d "${TMPDIR:-/var/tmp}/mkinitramfs-EFW_XXXXXXXXXX")
EFWCD="${EFWD}/d/kernel/x86/microcode"
# note: to build a reproducible early initramfs, we force
Expand Down
24 changes: 10 additions & 14 deletions core-initrd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,29 @@ originally in https://github.com/canonical/core-initrd. This contains
subfolders, each of them for a currently supported Ubuntu release.

Each subfolder contains the sources for a debian package. The `latest`
subdir contains the sources for the most recent Ubuntu release. To
build source packages that can later be built by Launchpad, checkout
the matching snapd release and run from this folder:
subdir contains the sources for the most recent Ubuntu release. When
releasing, first checkout the desired snapd release. Then `dch -i`
should be run for each package to update version and changelog, and
this should be committed to the snapd release and master branches.

To finally create source packages that can later be built by
Launchpad, run from this folder:

```
./build-source-pkgs.sh
```

This will pull the sources to build `snap-bootstrap` from the snapd
tree and copy duplicated files from the `latest` folder to older
releases. At this point `dch -i` should be run for each release to
update version and changelog, and this should be commited to the snapd
release and master branches. To build the source packages, run

```
gbp buildpackage -S -sa -d --git-ignore-branch
```

in each release subfolder. Then it is recommended to compare the
sources with the previous versions in the snappy-de PPA:
releases. Then it is recommended to compare the source packages with
the previous versions in the snappy-dev PPA:

```
dget https://launchpad.net/~snappy-dev/+archive/ubuntu/image/+sourcefiles/ubuntu-core-initramfs/<old_version>/ubuntu-core-initramfs_<old_version>.dsc
debdiff ubuntu-core-initramfs_<old_version>.dsc ubuntu-core-initramfs_<new_version>.dsc > diff.txt
```

And to finally upload with:
And finally upload with:

```
dput ppa:snappy-dev/image ubuntu-core-initramfs_<new_version>_source.changes
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/latest/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ package auto-import repo. To do that:
$ git subtree pull --prefix vendor/systemd/ https://git.launchpad.net/ubuntu/+source/systemd ubuntu/<release> --squash

Where release could be focal, jammy, etc. Note that when a development
version is released we will probably wnat `ubuntu/<release>-updates`
version is released we will probably want `ubuntu/<release>-updates`
branch instead.

When moving to a newer Ubuntu release, the way to update is to remove
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/latest/bin/ubuntu-core-initramfs
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ def main():
"--initrd", help="path to initramfs", default="/boot/ubuntu-core-initramfs.img"
)
efi_parser.add_argument(
"--cmdline", help="commandline to embed (can be overriden with LoadOptions)"
"--cmdline", help="commandline to embed (can be overridden with LoadOptions)"
)
efi_parser.add_argument(
"--unsigned", help="do not sign efi app", default=False, action="store_true"
Expand Down
2 changes: 1 addition & 1 deletion core-initrd/latest/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ Depends: ${python3:Depends}, ${misc:Depends}, dracut-core (>= 051-1),
dh-dlopenlibdeps
Description: standard embedded initrd
Standard embedded initrd implementation to be used with Ubuntu Core
systems. Currently targetting creating BLS Type2 like binaries.
systems. Currently targeting creating BLS Type2 like binaries.
2 changes: 1 addition & 1 deletion core-initrd/latest/debian/generate-x86-microcode
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
# Generates a copy of the minimal microcode for all AMD processors
# and installs it to the early initramfs

EFWE=$(realpath $1)
EFWE=$(realpath "$1")
EFWD=$(mktemp -d "${TMPDIR:-/var/tmp}/mkinitramfs-EFW_XXXXXXXXXX")
EFWCD="${EFWD}/d/kernel/x86/microcode"
# note: to build a reproducible early initramfs, we force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -eux

kill -USR1 $(systemctl show --property MainPID --value snapd.recovery-chooser-trigger.service)
kill -USR1 "$(systemctl show --property MainPID --value snapd.recovery-chooser-trigger.service)"
2 changes: 1 addition & 1 deletion core-initrd/latest/factory/usr/libexec/core/get-arg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ while [ -n "${current}" ]; do
# We cannot use subtring parameter expansion
# (e.g. ${cmdline:$i:1}) in busybox-initramfs
suffix="${current#?}"
char="${current%${suffix}}"
char="${current%"${suffix}"}"
current="${suffix}"
case "${char}" in
["${whitespaces}"])
Expand Down
10 changes: 5 additions & 5 deletions core-initrd/latest/postinst.d/ubuntu-core-initramfs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ if [ -n "$DEB_MAINT_PARAMS" ]; then
fi

# do not clobber pre-signed .efi
if [ -e /boot/kernel.efi-$version ]; then
if [ -e /boot/kernel.efi-"$version" ]; then
exit 0
fi

ubuntu-core-initramfs create-initrd --kernelver $version
ubuntu-core-initramfs create-initrd --kernelver "$version"

case `dpkg --print-architecture` in
case $(dpkg --print-architecture) in
amd64|arm64)
case $version in
*-azure)
# Currently nullboot doesn't seal cmdline, thus it must be baked in for azure
ubuntu-core-initramfs create-efi --unsigned --kernelver $version --cmdline "snapd_recovery_mode=cloudimg-rootfs console=tty1 console=ttyS0 earlyprintk=ttyS0"
ubuntu-core-initramfs create-efi --unsigned --kernelver "$version" --cmdline "snapd_recovery_mode=cloudimg-rootfs console=tty1 console=ttyS0 earlyprintk=ttyS0"
;;
*)
ubuntu-core-initramfs create-efi --unsigned --kernelver $version
ubuntu-core-initramfs create-efi --unsigned --kernelver "$version"
;;
esac
esac

0 comments on commit c57a5f8

Please sign in to comment.