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

enhancement #2

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

enhancement #2

wants to merge 4 commits into from

Conversation

skippie81
Copy link

Hi,

had some issues while building a new alpine lx zone image based on version 3.7

install script to create tarball:

Fix for alpien 3.7 where /usr/bin/su is not existing when trying to remove $INSTALL_DIR/usr/bin/su
so fist check if it exist

log showed

==> Making /usr/bin/su symlink relative
rm: cannot remove '/tmp/alpine/usr/bin/su': No such file or directory

the the exclude patterns in the exclude.txt used could potentially contain path that holds the entire chroot dir. For example if you use /tmp/xyz to build the tarball.
-> added dynamically created --exclude options based on the exclude.txt but dynamically adding the $INSTALL_DIR

# /install -r 3.7 -a apk-tools-static-2.8.2-r0.apk -d /tmp/alpine -m http://mirrors.gigenet.com/alpinelinux -i alpine-3 -p "Alpine Linux" -D "Alpine 3.7.0 64-bit lx-brand image." -u https://docs.joyent.com/images/container-native-linux
==> Installing Alpine into /tmp/alpine
...
==> Installation complete!
==> alpine-3-20180209.tar.gz
# ls -lth
total 52K
-rw-r----- 1 root    root      45 Feb  9 19:39 alpine-3-20180209.tar.gz

# tar tzvf alpine-3-20180209.tar.gz 
#

create-lx-image script:

as your can use any path as chroot in the install script the --strip-components=2 could potentially be the wrong amount of components to strip. So determinate the amount automatically

hope the contributions are helpful

regards
Joeri

dynamically create exclude list for tar command as the chroot path could be a subdir of a path in eclude list resulting in an empty tarball
@sskras
Copy link

sskras commented Jan 15, 2022

Any updates?

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.

None yet

2 participants