Skip to content

Commit

Permalink
live-build
Browse files Browse the repository at this point in the history
  • Loading branch information
adrelanos committed Jul 11, 2023
1 parent b31bdab commit dcdbcb9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
1 change: 1 addition & 0 deletions build-steps.d/3300_create-iso-chroot
Expand Up @@ -63,6 +63,7 @@ create-debian-iso-chroot() {
## Create the ISO chroot and initial ISO.
## Slightly wasteful because in the over next step the ISO will be deleted
## but the ISO chroot will be kept. However, ISO creation is useful as a test.
## TODO: skip creation of ISO
$SUDO_TO_ROOT \
$LIVEBUILD_PREFIX \
dist_build_multiarch_package_item="$dist_build_target_arch" \
Expand Down
26 changes: 22 additions & 4 deletions build-steps.d/3500_install-packages
Expand Up @@ -335,6 +335,15 @@ $dist_build_script_skip_package_install${reset}"
pkg-add-to-install-list grub-efi-arm64
fi

# if [ "$dist_build_iso" = "true" ]; then
# if [ -n "$EFI" ] ; then
# GRUB_PACKAGE=grub-efi-amd64
# else
# GRUB_PACKAGE=grub-pc
# fi
# pkg-add-to-install-list "$GRUB_PACKAGE"
# fi

## Weak recommended packages. No other package depends on it. Can be
## easily uninstalled. For better usability.
if [ "$dist_build_virtualbox" = "true" ]; then
Expand Down Expand Up @@ -459,15 +468,24 @@ $dist_build_script_skip_package_install${reset}"
## Since dracut was not run except before, grub config is still incomplete.
## Therefore creating functional /boot/grub/grub.cfg here.
## grub needs existing initrd for grub.cfg creation.
$SUDO_TO_ROOT $CHROOT update-grub
## Maybe unnecessary for ISO. Up to live-boot. Useful as a sanity test.
if [ "$dist_build_iso" = "true" ]; then
true "INFO: Bootloder configuration is up to live-build."
else
$SUDO_TO_ROOT $CHROOT update-grub
fi

## Debugging.
true "/boot/grub/grub.cfg root= :"
$SUDO_TO_ROOT $CHROOT cat /boot/grub/grub.cfg | grep --color "root=" || true

## Sanity test.
if $SUDO_TO_ROOT $CHROOT cat /boot/grub/grub.cfg | grep --quiet "root=/dev/mapper" ; then
error "chroot /boot/grub/grub.cfg contains /dev/mapper - image most likely unbootable!"
if [ "$dist_build_iso" = "true" ]; then
true "INFO: Skipping /boot/grub/grub.cfg containing root=/dev/mapper test, ok."
else
## Sanity test.
if $SUDO_TO_ROOT $CHROOT cat /boot/grub/grub.cfg | grep --quiet "root=/dev/mapper" ; then
error "chroot /boot/grub/grub.cfg contains /dev/mapper - image most likely unbootable!"
fi
fi

"$dist_source_help_steps_folder/remove-local-temp-apt-repo" "$@"
Expand Down
12 changes: 12 additions & 0 deletions build-steps.d/4700_create-iso-image
Expand Up @@ -25,6 +25,18 @@ create-debian-iso-image() {

cd "$binary_build_folder_live_build"

## XXX
## live-build bug?
# P: Begin building root filesystem image...
# 0+0 records in
# 0+0 records out
# 0 bytes copied, 2.8103e-05 s, 0.0 kB/s
# ln: failed to create symbolic link '/etc/mtab': File exists
# E: An unexpected failure occurred, exiting...
if $SUDO_TO_ROOT test -L "$CHROOT_FOLDER/etc/mtab" ; then
$SUDO_TO_ROOT unlink "$CHROOT_FOLDER/etc/mtab"
fi

## Delete the ISO.
$SUDO_TO_ROOT \
$LIVEBUILD_PREFIX \
Expand Down

0 comments on commit dcdbcb9

Please sign in to comment.