Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for arch install scripts #75

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gportay
Copy link

@gportay gportay commented Jun 27, 2020

Hello,

This is a PR to support for the Arch Linux scripts pacstrap and arch-chroot that are helpers scripts used to create an Arch Linux rootfs. These scripts are available here. The pacstrap is the Arch Linux variant for debootstrap.

An Arch Linux rootfs is typically generated using the command below:

mkdir rootfs
fakeroot -- fakechroot -- pacstrap rootfs base
fakeroot -- fakechroot -- arch-chroot rootfs bash -c "pacman-key --init && pacman-key --populate archlinux"

Note: For some reason related to GPG that I am not yet able to fix yet (help is needed, I cannot provide the error), both commands pacman-key must be run in the same shell (i.e. fakeroot -- fakechroot -- arch-chroot rootfs pacman-key --init; fakeroot -- fakechroot -- arch-chroot rootfs pacman-key --populate archlinux does not work, the latter command fails).

Also, the environment scripts do not work out of the box after make install. This is because of the paths /sbin that are hard-coded. I have variants that work properly by guessing dynamically the path the command substitution using which [they should use command -v at the time of writing that PR]. I preferred to submit scripts that are coherents with the ones that exist already to remain consistent with the project.

# Set a list of command substitutions needed by pacstrap
fakechroot_pacstrap_env_cmd_subst="$(which mount || echo /usr/bin/mount)=/usr/bin/true
$(which umount || echo /usr/bin/umount)=/usr/bin/true
$(which ldconfig || echo /usr/bin/ldconfig)=/usr/bin/true
$(which ldd || echo /usr/bin/ldd)=${fakechroot_bindir:-/usr/bin}/ldd.fakechroot
$(which unshare || echo /usr/bin/unshare)=${fakechroot_bindir:-/usr/bin}/unshare.fakechroot
$(which chroot || echo /usr/sbin/chroot)=${fakechroot_bindir:-/usr/sbin}/chroot.fakechroot"

Instead of

# Set a list of command substitutions needed by pacstrap
fakechroot_pacstrap_env_cmd_subst="@MOUNT@=/bin/true
@UMOUNT@=/bin/true
@CHROOT@=${fakechroot_bindir:-@sbindir@}/chroot.fakechroot
@UNSHARE@=${fakechroot_bindir:-@bindir@}/unshare.fakechroot
@LDCONFIG@=/bin/true
@LDD@=${fakechroot_bindir:-@bindir@}/ldd.fakechroot"

What do you think?

@gportay
Copy link
Author

gportay commented Jun 27, 2020

I have planned to make a test for this. That is why that PR is a WIP.

@gportay gportay force-pushed the add-support-for-arch-install-scripts branch from ff8c3bc to 9db6014 Compare July 9, 2020 12:22
@gportay gportay changed the title WIP: Add support for arch install scripts Add support for arch install scripts Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant