Commit 44eaf19b authored by intrigeri's avatar intrigeri

Merge remote-tracking branch...

Merge remote-tracking branch 'johanbluecreek/bugfix/17179-proper-chroot-for-syslinux' into stable (Closes: #17179)
parents 8614583e 19420523
......@@ -154,7 +154,10 @@ echo "I: ISO image was successfully created"
print_iso_size binary.iso
echo "I: Hybriding it..."
isohybrid $AMNESIA_ISOHYBRID_OPTS binary.iso || fatal "isohybrid failed"
touch chroot/binary.iso
mount --bind binary.iso chroot/binary.iso
chroot chroot isohybrid $AMNESIA_ISOHYBRID_OPTS binary.iso || fatal "isohybrid failed"
umount chroot/binary.iso
print_iso_size binary.iso
truncate -s %2048 binary.iso
print_iso_size binary.iso
......
......@@ -44,7 +44,6 @@ SYSTEM_PARTITION_ADDITIONAL_SIZE = 10
# the same syslinux version here and in Tails Installer is important to
# prevent issues when upgrading a Tails device via Tails Installer.
CHROOT_SYSLINUX_COM32MODULES_DIR = 'chroot/usr/lib/syslinux/modules/bios'
CHROOT_SYSLINUX_BIN='chroot/usr/bin/syslinux'
class ImageCreationError(Exception):
pass
......@@ -267,17 +266,33 @@ class ImageCreator(object):
src_path,
"::%s" % os.path.join('syslinux', module)])
@contextmanager
def mount_proc_and_image(self):
logger.info("Mounting proc and image")
execute(['mount', '--types', 'proc', '/proc', 'chroot/proc'])
execute(['mkdir', '-p', 'chroot%s' % os.path.dirname(self.image)])
execute(['touch', 'chroot%s' % self.image])
execute(['mount', '--bind', self.image, 'chroot%s' % self.image])
try:
yield
finally:
logger.info("Unmounting proc and image")
execute(['umount', 'chroot/proc'])
execute(['umount', 'chroot%s' % self.image])
def install_syslinux(self):
logger.info("Installing bootloader")
# We install syslinux directly on the image. Installing it on the loop
# device would cause this issue:
# https://bugs.chromium.org/p/chromium/issues/detail?id=508713#c8
execute([
CHROOT_SYSLINUX_BIN,
'--offset', str(self.partition.props.partition.props.offset),
'--directory', '/syslinux/',
'--install', self.image
])
with self.mount_proc_and_image():
execute([
'chroot', 'chroot',
'/usr/bin/syslinux',
'--offset', str(self.partition.props.partition.props.offset),
'--directory', '/syslinux/',
'--install', self.image
])
def set_guids(self):
logger.info("Setting disk and partition GUID")
......
......@@ -107,9 +107,6 @@ apt-get -y install \
python3-gi \
rsync \
ruby \
syslinux \
syslinux-common \
syslinux-utils \
time \
udisks2
......
......@@ -127,7 +127,7 @@ Each file here corresponds to an APT suite on `deb.tails.boum.org` to
be used. E.g. if we have `config/APT_overlays.d/feature-1234-example`
then the `feature-1234-example` APT suite will be used. Each branch
that is pushed to Tails' main Git repo will automatically have such a
suite created (but with illegal charactes changed to `-`, so
suite created (but with illegal characters changed to `-`, so
`feature/1234-example` becomes `feature-1234-example`).
This is useful for importing specific package versions in between
......@@ -244,7 +244,7 @@ is built, in order:
`config/chroot_local-packageslists/tails-common.list` are
installed.
4. Packages stored in `config/chroot_local-packages/` are installed.
5. Everyting in `config/chroot_local-includes/` is copied to `/`,
5. Everything in `config/chroot_local-includes/` is copied to `/`,
overwriting existing files.
6. All patches in `config/chroot_local-patches/` are applied on `/`.
7. All build-time hooks in `config/chroot_local-hooks/` are run.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment