Skip to content

Commit

Permalink
ido: use ish
Browse files Browse the repository at this point in the history
  • Loading branch information
gportay committed May 8, 2024
1 parent 2c76f3f commit d708b6a
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 57 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Preload the iamroot library not using `IAMROOT_LIB` if `LD_PRELOAD` is unset
and not in a chroot'ed environment
- Strip leading `ld_library_path` from the content of `LD_LIBRARY_PATH`
- `ido(1)` is now using `ish(1)`

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,12 @@ multiarch-ish: ISHFLAGS += --multiarch
multiarch-ish: ish

.PHONY: ido
ido: PATH := $(CURDIR):$(PATH)
ido: libiamroot.so
bash ido $(IDOFLAGS) -i

.PHONY: ish
ish: PATH := $(CURDIR):$(PATH)
ish: libiamroot.so
bash ish $(ISHFLAGS)

Expand Down
16 changes: 3 additions & 13 deletions ido
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,9 @@ then
set -- "${vars[@]}" "$@"
fi

if [[ "$IAMROOT_ROOT" ]]
if ! ish="$(command -v ish 2>/dev/null)"
then
cd "$IAMROOT_ROOT"
PWD="/"

IFS=: read -r -a __ <<<"${LD_LIBRARY_PATH:-/usr/lib:/lib}"
LD_LIBRARY_PATH="$IAMROOT_ROOT${__[0]}"
for i in "${__[@]:1}"
do
LD_LIBRARY_PATH+=":$IAMROOT_ROOT${__[0]}"
done
ish="/usr/local/bin/ish"
fi

command=("${shell:-/bin/sh}")
Expand All @@ -451,6 +443,4 @@ USER="${passwd[0]}" \
HOME="${HOME:-${passwd[5]}}" \
SHELL="${shell:-${passwd[6]}}" \
TERM="${TERM:-unknown}" \
LD_PRELOAD="${IAMROOT_LIB:-${IAMROOT_ORIGIN:-/usr/local/lib/iamroot}/libiamroot.so}${LD_PRELOAD+:$LD_PRELOAD}" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
"${command_timeout[@]}" "${command[@]}"
"${command_timeout[@]}" "${ish:-/usr/local/bin/ish}" --shell "${command[@]}"
3 changes: 2 additions & 1 deletion support/freebsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ $(O)-%:
freebsd-13.1-chroot:
freebsd-%-chroot: export IDO_SECURE_PATH = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
freebsd-%-chroot: export SHELL = /bin/sh
freebsd-%-chroot: PATH := $(CURDIR):$(PATH)
freebsd-%-chroot: $(ARCH)/libiamroot-elf.so.1 | freebsd-%-rootfs
bash ido $(IDOFLAGS) chroot freebsd-$*-rootfs
ido $(IDOFLAGS) chroot freebsd-$*-rootfs

freebsd-13.1-rootfs:
freebsd-%-rootfs: | $(ARCH)/libiamroot-elf.so.1 FreeBSD-%-RELEASE-base-$(ARCH).txz
Expand Down
97 changes: 56 additions & 41 deletions support/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ endef

define chroot_shell
.PHONY: $(1)-$(2)-chroot
$(1)-$(2)-chroot: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-chroot: | $(1)-$(2)-rootfs
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs $(3)
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs $(3)

.PHONY: $(1)-$(2)-shell
$(1)-$(2)-shell: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-shell: libiamroot.so
@echo $(4)
bash ish
ish
endef

define pacstrap-rootfs
Expand All @@ -156,9 +158,10 @@ $(1)-$(2)-chroot $(1)-$(2)-shell $(1)-$(2)-rootfs/bin/sh: export EUID = 0
$(eval $(call chroot_shell,$(1),$(2),/bin/bash,pacstrap -GMC support/$(1)-$(2)-pacman.conf $(1)-$(2)-rootfs $(3)))

$(1)-$(2)-rootfs: | $(1)-$(2)-rootfs/bin/sh
$(1)-$(2)-rootfs/bin/sh: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-rootfs/bin/sh: | $(call libs,linux,$(1))
bash ido $$(IDOFLAGS) mkdir -p $(1)-$(2)-rootfs
bash ido $$(IDOFLAGS) pacstrap -GMC support/$(1)-$(2)-pacman.conf $(1)-$(2)-rootfs $(3)
ido $$(IDOFLAGS) mkdir -p $(1)-$(2)-rootfs
ido $$(IDOFLAGS) pacstrap -GMC support/$(1)-$(2)-pacman.conf $(1)-$(2)-rootfs $(3)

$(eval $(call log,pacstrap,$(1)-$(2)-rootfs))

Expand All @@ -185,11 +188,12 @@ $(1)-$(2)-$(3)-chroot $(1)-$(2)-$(3)-shell $(1)-$(2)-$(3)-rootfs/bin/sh: export
$(eval $(call chroot_shell,$(1),$(2)-$(3),/bin/bash,debootstrap --keep-debootstrap-dir $$(DEBOOTSTRAPFLAGS) $(3) $(1)-$(2)-$(3)-rootfs $$(DEBOOTSTRAP_MIRROR) $$(DEBOOTSTRAP_SCRIPT)))

$(1)-$(2)-$(3)-rootfs: | $(1)-$(2)-$(3)-rootfs/bin/sh
$(1)-$(2)-$(3)-rootfs/bin/sh: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-$(3)-rootfs/bin/sh: | $(call libs,linux,$(1))
bash ido $$(IDOFLAGS) mkdir -p $(1)-$(2)-$(3)-rootfs
bash ido $$(IDOFLAGS) debootstrap --keep-debootstrap-dir --arch=$(1) $$(DEBOOTSTRAPFLAGS) $(3) $(1)-$(2)-$(3)-rootfs $$(DEBOOTSTRAP_MIRROR) $$(DEBOOTSTRAP_SCRIPT)
bash ido $$(IDOFLAGS) cat $(1)-$(2)-$(3)-rootfs/debootstrap/debootstrap.log
bash ido $$(IDOFLAGS) rm -Rf $(1)-$(2)-$(3)-rootfs/debootstrap/
ido $$(IDOFLAGS) mkdir -p $(1)-$(2)-$(3)-rootfs
ido $$(IDOFLAGS) debootstrap --keep-debootstrap-dir --arch=$(1) $$(DEBOOTSTRAPFLAGS) $(3) $(1)-$(2)-$(3)-rootfs $$(DEBOOTSTRAP_MIRROR) $$(DEBOOTSTRAP_SCRIPT)
ido $$(IDOFLAGS) cat $(1)-$(2)-$(3)-rootfs/debootstrap/debootstrap.log
ido $$(IDOFLAGS) rm -Rf $(1)-$(2)-$(3)-rootfs/debootstrap/

$(eval $(call log,debootstrap,$(1)-$(2)-$(3)-rootfs))

Expand All @@ -207,10 +211,11 @@ $(1)-$(2)-$(3)-chroot $(1)-$(2)-$(3)-shell $(1)-$(2)-$(3)-rootfs/bin/sh: export
$(eval $(call chroot_shell,$(1),$(2)-$(3),/bin/bash,dnf --forcearch $(1) --releasever $(3) --assumeyes --installroot $(CURDIR)/$(1)-$(2)-$(3)-rootfs group install minimal-environment))

$(1)-$(2)-$(3)-rootfs: | $(1)-$(2)-$(3)-rootfs/bin/sh
$(1)-$(2)-$(3)-rootfs/bin/sh: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-$(3)-rootfs/bin/sh: | $(call libs,linux,$(1))
bash ido $$(IDOFLAGS) install -D -m644 $$(FEDORA_REPO) $(1)-$(2)-$(3)-rootfs/etc/distro.repos.d/fedora.repo
bash ido $$(IDOFLAGS) dnf --forcearch $(1) --releasever $(3) --assumeyes --installroot $(CURDIR)/$(1)-$(2)-$(3)-rootfs group install minimal-environment
bash ido $$(IDOFLAGS) rm -f $(1)-$(2)-$(3)-rootfs/etc/distro.repos.d/fedora.repo
ido $$(IDOFLAGS) install -D -m644 $$(FEDORA_REPO) $(1)-$(2)-$(3)-rootfs/etc/distro.repos.d/fedora.repo
ido $$(IDOFLAGS) dnf --forcearch $(1) --releasever $(3) --assumeyes --installroot $(CURDIR)/$(1)-$(2)-$(3)-rootfs group install minimal-environment
ido $$(IDOFLAGS) rm -f $(1)-$(2)-$(3)-rootfs/etc/distro.repos.d/fedora.repo

$(eval $(call log,dnf,$(1)-$(2)-$(3)-rootfs))

Expand All @@ -229,9 +234,10 @@ $(1)-$(2)-chroot $(1)-$(2)-shell $(1)-$(2)-rootfs/bin/sh: export PATH = /usr/bin
$(eval $(call chroot_shell,$(1),$(2),/bin/bash,zypper --root $(CURDIR)/$(1)-$(2)-rootfs --non-interactive --no-gpg-checks install patterns-base-minimal_base zypper systemd))

$(1)-$(2)-rootfs: | $(1)-$(2)-rootfs/bin/sh
$(1)-$(2)-rootfs/bin/sh: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-rootfs/bin/sh: | $(call libs,linux,$(1))
bash ido $$(IDOFLAGS) zypper --root $(CURDIR)/$(1)-$(2)-rootfs addrepo --no-gpgcheck support/$(2)-repo-oss.repo
bash ido $$(IDOFLAGS) zypper --root $(CURDIR)/$(1)-$(2)-rootfs --non-interactive --no-gpg-checks install patterns-base-minimal_base zypper systemd
ido $$(IDOFLAGS) zypper --root $(CURDIR)/$(1)-$(2)-rootfs addrepo --no-gpgcheck support/$(2)-repo-oss.repo
ido $$(IDOFLAGS) zypper --root $(CURDIR)/$(1)-$(2)-rootfs --non-interactive --no-gpg-checks install patterns-base-minimal_base zypper systemd

$(eval $(call log,zypper,$(1)-$(2)-rootfs))

Expand All @@ -249,9 +255,10 @@ $(eval $(call chroot_shell,$(1),$(2),/bin/bash,xbps-install -S -r $(1)-$(2)-root
$(1)-$(2)-rootfs: | $(1)-$(2)-rootfs/bin/sh
$(1)-$(2)-rootfs/bin/sh: export XBPS_ARCH=$(1)
$(1)-$(2)-rootfs/bin/sh: IDOFLAGS += --preserve-env=XBPS_ARCH
$(1)-$(2)-rootfs/bin/sh: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-rootfs/bin/sh: | $(call libs,linux,$(1))
bash ido $$(IDOFLAGS) install -D -t $(1)-$(2)-rootfs/var/db/xbps/keys/ /var/db/xbps/keys/*
bash ido $$(IDOFLAGS) xbps-install -S -y -r $(1)-$(2)-rootfs -R http://repo-default.voidlinux.org/current base-system
ido $$(IDOFLAGS) install -D -t $(1)-$(2)-rootfs/var/db/xbps/keys/ /var/db/xbps/keys/*
ido $$(IDOFLAGS) xbps-install -S -y -r $(1)-$(2)-rootfs -R http://repo-default.voidlinux.org/current base-system

$(eval $(call log,xbps-install,$(1)-$(2)-rootfs))
endef
Expand All @@ -264,9 +271,10 @@ $(eval $(call chroot_shell,$(1),$(2)-musl,/bin/bash,xbps-install -S -r $(1)-$(2)
$(1)-$(2)-musl-rootfs: | $(1)-$(2)-musl-rootfs/bin/sh
$(1)-$(2)-musl-rootfs/bin/sh: export XBPS_ARCH=$(1)-musl
$(1)-$(2)-musl-rootfs/bin/sh: IDOFLAGS += --preserve-env=XBPS_ARCH
$(1)-$(2)-musl-rootfs/bin/sh: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-musl-rootfs/bin/sh: | $(call libs,musl,$(1))
bash ido $$(IDOFLAGS) install -D -t $(1)-$(2)-musl-rootfs/var/db/xbps/keys/ /var/db/xbps/keys/*
bash ido $$(IDOFLAGS) xbps-install -S -y -r $(1)-$(2)-musl-rootfs -R http://repo-default.voidlinux.org/current/musl base-system
ido $$(IDOFLAGS) install -D -t $(1)-$(2)-musl-rootfs/var/db/xbps/keys/ /var/db/xbps/keys/*
ido $$(IDOFLAGS) xbps-install -S -y -r $(1)-$(2)-musl-rootfs -R http://repo-default.voidlinux.org/current/musl base-system

$(eval $(call log,xbps-install,$(1)-$(2)-musl-rootfs))
endef
Expand All @@ -280,8 +288,9 @@ $(1)-$(2)-$(3)-shell $(1)-$(2)-$(3)-rootfs/bin/busybox: export ALPINE_MAKE_ROOTF
$(eval $(call chroot_shell,$(1),$(2)-$(3),/bin/ash,alpine-make-rootfs $(1)-$(2)-$(3)-rootfs --keys-dir /usr/share/apk/keys/$(1) --mirror-uri http://mirrors.edge.kernel.org/alpine --branch $(3)))

$(1)-$(2)-$(3)-rootfs: | $(1)-$(2)-$(3)-rootfs/bin/busybox
$(1)-$(2)-$(3)-rootfs/bin/busybox: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-$(3)-rootfs/bin/busybox: | $(call libs,musl,$(1))
bash ido $$(IDOFLAGS) alpine-make-rootfs $(1)-$(2)-$(3)-rootfs --keys-dir /usr/share/apk/keys/$(1) --mirror-uri http://mirrors.edge.kernel.org/alpine --branch $(3) $$(ALPINE_MAKE_ROOTFSFLAGS)
ido $$(IDOFLAGS) alpine-make-rootfs $(1)-$(2)-$(3)-rootfs --keys-dir /usr/share/apk/keys/$(1) --mirror-uri http://mirrors.edge.kernel.org/alpine --branch $(3) $$(ALPINE_MAKE_ROOTFSFLAGS)

$(eval $(call log,alpine-make-rootfs,$(1)-$(2)-$(3)-rootfs))

Expand Down Expand Up @@ -331,21 +340,23 @@ endif
ifneq ($(VMLINUX_KVER),)
MODULESDIRS_$(1)-$(2) += $(1)-$(2)-rootfs/usr/lib/modules/$(VMLINUX_KVER)
endif
$(1)-$(2).ext4: PATH := $(CURDIR):$(PATH)
$(1)-$(2).ext4: | x86_64/libiamroot-linux-x86-64.so.2 $(1)-$(2)-rootfs $$(MODULESDIRS_$(1)-$(2))
$(MAKE) $(1)-$(2)-postrootfs
rm -f $$@.tmp
fallocate --length 2G $$@.tmp
bash ido $$(IDOFLAGS) mkfs.ext4 -d $(1)-$(2)-rootfs $$@.tmp
ido $$(IDOFLAGS) mkfs.ext4 -d $(1)-$(2)-rootfs $$@.tmp
mv $$@.tmp $$@

.PHONY: $(1)-$(2)-postrootfs
$(1)-$(2)-postrootfs:

.PRECIOUS: $(1)-$(2)-rootfs/usr/lib/modules/$(KVER) $(1)-$(2)-rootfs/usr/lib/modules/$(VMLINUX_KVER)
$(1)-$(2)-rootfs/usr/lib/modules/$(KVER) $(1)-$(2)-rootfs/usr/lib/modules/$(VMLINUX_KVER): PATH := $(CURDIR):$(PATH)
$(1)-$(2)-rootfs/usr/lib/modules/$(KVER) $(1)-$(2)-rootfs/usr/lib/modules/$(VMLINUX_KVER): | x86_64/libiamroot-linux-x86-64.so.2 $(1)-$(2)-rootfs
rm -Rf $$@.tmp $$@
bash ido $$(IDOFLAGS) mkdir -p $$(@D)
bash ido $$(IDOFLAGS) rsync -a /usr/lib/modules/$$(@F)/. $$@.tmp/.
ido $$(IDOFLAGS) mkdir -p $$(@D)
ido $$(IDOFLAGS) rsync -a /usr/lib/modules/$$(@F)/. $$@.tmp/.
mv $$@.tmp $$@

.PHONY: chroot-$(1)-$(2)
Expand All @@ -364,38 +375,41 @@ umount-$(1)-$(2): | mnt
endef

define pacstrap-postrootfs
$(1)-$(2)-postrootfs: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-postrootfs: | x86_64/libiamroot-linux-x86-64.so.2
sed -e '/^root:x:/s,^root:x:,root::,' \
-i $(1)-$(2)-rootfs/etc/passwd
sed -e '/^root::/s,^root::,root:x:,' \
-i $(1)-$(2)-rootfs/etc/shadow
mkdir -p $(1)-$(2)-rootfs/var/lib/systemd/linger
rm -f $(1)-$(2)-rootfs/etc/systemd/system/getty.target.wants/getty@tty0.service
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service
endef

define debootstrap-postrootfs
$(1)-$(2)-postrootfs: IDOFLAGS += --multiarch
$(1)-$(2)-postrootfs: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-postrootfs: | x86_64/libiamroot-linux-x86-64.so.2
sed -e '/^root:x:/s,^root:x:,root::,' \
-i $(1)-$(2)-rootfs/etc/passwd
sed -e '/^root::/s,^root::,root:x:,' \
-i $(1)-$(2)-rootfs/etc/shadow
if test -e $(1)-$(2)-rootfs/lib/systemd/systemd; then \
rm -f $(1)-$(2)-rootfs/etc/systemd/system/getty.target.wants/getty@tty0.service; \
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service; \
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service; \
rm -f $(1)-$(2)-rootfs/etc/systemd/system/multi-user.target.wants/sshd.service; \
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl disable sshd.service; \
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl disable sshd.service; \
else \
sed -e '/^1:/i0:2345:respawn:/sbin/getty --noclear 38400 tty0' \
-e '/^[1-9]:/s,^,#,' \
-e '/^#T0:/s,^#,,g' \
-i $(1)-$(2)-rootfs/etc/inittab; \
fi
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs pam-auth-update
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs pam-auth-update
endef

define dnf-postrootfs
$(1)-$(2)-postrootfs: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-postrootfs: | x86_64/libiamroot-linux-x86-64.so.2
sed -e '/^root:x:/s,^root:x:,root::,' \
-i $(1)-$(2)-rootfs/etc/passwd
Expand All @@ -404,23 +418,24 @@ $(1)-$(2)-postrootfs: | x86_64/libiamroot-linux-x86-64.so.2
touch $(1)-$(2)-rootfs/etc/systemd/zram-generator.conf
mkdir -p $(1)-$(2)-rootfs/var/lib/systemd/linger
rm -f $(1)-$(2)-rootfs/etc/systemd/system/getty.target.wants/getty@tty0.service
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service
rm -f $(1)-$(2)-rootfs/etc/systemd/system/multi-user.target.wants/sshd.service
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl disable sshd.service
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl disable sshd.service
endef

define zypper-postrootfs
$(1)-$(2)-postrootfs: PATH := $(CURDIR):$(PATH)
$(1)-$(2)-postrootfs: | x86_64/libiamroot-linux-x86-64.so.2
sed -e '/^root:x:/s,^root:x:,root::,' \
-i $(1)-$(2)-rootfs/etc/passwd
sed -e '/^root:\*:/s,^root:\*:,root:x:,' \
-i $(1)-$(2)-rootfs/etc/shadow
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs pam-config -a --nullok
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs pam-config -a --nullok
mkdir -p $(1)-$(2)-rootfs/var/lib/systemd/linger
rm -f $(1)-$(2)-rootfs/etc/systemd/system/getty.target.wants/getty@tty0.service
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@tty0.service
rm -f $(1)-$(2)-rootfs/etc/systemd/system/getty.target.wants/getty@ttyS0.service
bash ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@ttyS0.service
ido $$(IDOFLAGS) chroot $(1)-$(2)-rootfs systemctl enable getty@ttyS0.service
endef

define alpinelinux-postrootfs
Expand Down Expand Up @@ -774,8 +789,8 @@ ifneq ($(shell command -v pacstrap 2>/dev/null),)
archlinux-test: | x86_64-archlinux-rootfs/usr/bin/shebang.sh
archlinux-test: | x86_64-archlinux-rootfs/usr/bin/shebang-arg.sh
archlinux-test: $(subst $(CURDIR)/,,$(IAMROOT_LIB)) | x86_64-archlinux-rootfs
bash ido $(IDOFLAGS) chroot x86_64-archlinux-rootfs shebang.sh one two three
bash ido $(IDOFLAGS) chroot x86_64-archlinux-rootfs shebang-arg.sh one two three
ido $(IDOFLAGS) chroot x86_64-archlinux-rootfs shebang.sh one two three
ido $(IDOFLAGS) chroot x86_64-archlinux-rootfs shebang-arg.sh one two three

x86_64-archlinux-rootfs/usr/bin/%: support/% | x86_64-archlinux-rootfs
cp $< $@
Expand Down Expand Up @@ -1058,14 +1073,14 @@ alpine-test: | x86_64-alpine-mini-rootfs/usr/bin/shebang.sh
alpine-test: | x86_64-alpine-mini-rootfs/usr/bin/shebang-arg.sh
alpine-test: | x86_64-alpine-mini-rootfs/usr/bin/shebang-busybox.sh
alpine-test: $(call libs,musl,x86_64) | x86_64-alpine-mini-rootfs
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs pwd | tee /dev/stderr | grep -q "^/\$$"
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs cat /etc/os-release | tee /dev/stderr | grep 'NAME="Alpine Linux"'
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs chroot . cat /etc/os-release | tee /dev/stderr | grep 'NAME="Alpine Linux"'
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs /bin/busybox
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs shebang.sh one two three
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs shebang-arg.sh one two three
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs shebang-busybox.sh one two three
bash ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs /lib/ld-musl-x86_64.so.1 --preload "$$PWD/x86_64/libiamroot-musl-x86_64.so.1" bin/busybox
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs pwd | tee /dev/stderr | grep -q "^/\$$"
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs cat /etc/os-release | tee /dev/stderr | grep 'NAME="Alpine Linux"'
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs chroot . cat /etc/os-release | tee /dev/stderr | grep 'NAME="Alpine Linux"'
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs /bin/busybox
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs shebang.sh one two three
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs shebang-arg.sh one two three
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs shebang-busybox.sh one two three
ido $(IDOFLAGS) chroot x86_64-alpine-mini-rootfs /lib/ld-musl-x86_64.so.1 --preload "$$PWD/x86_64/libiamroot-musl-x86_64.so.1" bin/busybox

rootfs: alpinelinux-rootfs

Expand Down Expand Up @@ -1652,7 +1667,7 @@ endif

.PHONY: static-chroot
static-chroot: x86_64/libiamroot-linux-x86-64.so.2 | static-rootfs
bash ido $(IDOFLAGS) chroot static-rootfs /bin/sh
ido $(IDOFLAGS) chroot static-rootfs /bin/sh

.PHONY: static-rootfs
static-rootfs: static-rootfs/usr/bin/sh
Expand Down
3 changes: 2 additions & 1 deletion support/netbsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ $(O)-%:

netbsd-9.3-chroot: export IDO_SECURE_PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R7/bin:/usr/local/sbin:/usr/local/bin
netbsd-9.3-chroot: export SHELL = /bin/sh
netbsd-9.3-chroot: PATH := $(CURDIR):$(PATH)
netbsd-9.3-chroot: $(ARCH)/libiamroot.elf_so | netbsd-9.3-rootfs
bash ido $(IDOFLAGS) chroot netbsd-9.3-rootfs
ido $(IDOFLAGS) chroot netbsd-9.3-rootfs

ifeq ($(ARCH),x86_64)
netbsd-9.3-rootfs: | $(ARCH)/libiamroot.elf_so base.tar.xz
Expand Down
3 changes: 2 additions & 1 deletion support/openbsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ $(O)-%:

openbsd-7.3-chroot: export IDO_SECURE_PATH = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
openbsd-7.3-chroot: export SHELL = /bin/sh
openbsd-7.3-chroot: PATH := $(CURDIR):$(PATH)
openbsd-7.3-chroot: $(ARCH)/libiamroot.so | openbsd-7.3-rootfs
bash ido $(IDOFLAGS) chroot openbsd-7.3-rootfs
ido $(IDOFLAGS) chroot openbsd-7.3-rootfs

openbsd-7.3-rootfs: | $(ARCH)/libiamroot.so base.tgz
rm -Rf $@
Expand Down

0 comments on commit d708b6a

Please sign in to comment.