-
Notifications
You must be signed in to change notification settings - Fork 24
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
Clean up the addition of extra directories and/or files #125
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -144,6 +144,21 @@ distro_vars="${script_dir}/${_distro}_vars.sh" | |||||
|
||||||
pushd "$_arg_working_dir" > /dev/null || fail "couldn't cd to $_arg_working_dir" | ||||||
|
||||||
# save the working directory | ||||||
working_dir=$(pwd) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why save it again? It's already in |
||||||
|
||||||
# make a path canonical to the working dir | ||||||
make_canonical_path() | ||||||
{ | ||||||
local p=$1 | ||||||
|
||||||
p=$(eval echo $p) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this line do? |
||||||
pushd $working_dir > /dev/null | ||||||
p=$(realpath $p) | ||||||
popd > /dev/null | ||||||
echo $p | ||||||
} | ||||||
|
||||||
set_valid_mkosi_ver() | ||||||
{ | ||||||
"$mkosi_bin" --version | ||||||
|
@@ -1125,6 +1140,7 @@ make_rootfs() | |||||
process_mkosi_template "$tmpl" > "$dst" | ||||||
done | ||||||
|
||||||
# Add user space items from host | ||||||
rsync -a "${script_dir}"/mkosi/extra/ mkosi.extra/ | ||||||
|
||||||
# misc rootfs setup | ||||||
|
@@ -1148,17 +1164,30 @@ make_rootfs() | |||||
if [ -f ~/.vimrc ]; then | ||||||
rsync "${rsync_opts[@]}" ~/.vim* mkosi.extra/root/ | ||||||
fi | ||||||
mkdir -p mkosi.extra/root/bin | ||||||
if [ -d ~/git/extra-scripts ]; then | ||||||
rsync "${rsync_opts[@]}" ~/git/extra-scripts/bin/* mkosi.extra/root/bin/ | ||||||
fi | ||||||
if [[ $_arg_ndctl_build == "on" ]]; then | ||||||
if [ -n "$ndctl" ]; then | ||||||
rsync "${rsync_opts[@]}" "$ndctl/" mkosi.extra/root/ndctl | ||||||
prepare_ndctl_build # create mkosi.postinst which compiles | ||||||
fi | ||||||
fi | ||||||
|
||||||
if [[ "$_arg_extra_dirs" ]]; then | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
extra_dirs=$(make_canonical_path $_arg_extra_dirs) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||||||
if [[ ! -f $extra_dirs ]]; then | ||||||
fail "$extra_dirs not found" | ||||||
fi | ||||||
echo "Installing extra directories and files from: $extra_dirs" | ||||||
for d in `cat "$extra_dirs"`; do | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://www.shellcheck.net/wiki/SC2006
Don't forget the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
d=$(make_canonical_path $d) | ||||||
echo " $d" | ||||||
if [[ -e $d ]]; then | ||||||
rsync -a "$d" mkosi.extra/root/ | ||||||
else | ||||||
fail "$d not found" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fi | ||||||
done | ||||||
fi | ||||||
|
||||||
# timedatectl defaults to UTC when /etc/localtime is missing | ||||||
local bld_tz; bld_tz=$( timedatectl | awk '/zone:/ { print $3 }' ) | ||||||
# v15 commit f11325afa02c "Adopt systemd-firstboot" | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to say that:
.
)