summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2021-01-16 09:17:40 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2021-01-16 09:18:44 (EST)
commit7efef6434e0d4101b04cbce538526c31dcbd8ae2 (patch)
tree02352ca6b7414ad17345f0ec71ee9fb8ea6bcd31 /src
parent4ea1459ebbc51e19f7e7e9985db450e521c54681 (diff)
profile_make_initramfs(): Remove all but /boot
Diffstat (limited to 'src')
-rw-r--r--src/profile/proteanos.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/profile/proteanos.sh b/src/profile/proteanos.sh
index 28d2bbd..87001a6 100644
--- a/src/profile/proteanos.sh
+++ b/src/profile/proteanos.sh
@@ -417,6 +417,7 @@ prof_proteanos_make_initramfs()
local plat="${2}"
shift 2
local init_created=
+ local boot_created=
case "${arch}" in
*-linux-*)
@@ -426,7 +427,12 @@ prof_proteanos_make_initramfs()
else
init_created=false
fi
- mkdir -p boot
+ if ! [ -d boot ]; then
+ mkdir boot
+ boot_created=true
+ else
+ boot_created=false
+ fi
find . -xdev -a \! -path './boot/*' -a \
\! -path './prokit/*' | \
${CPIO} -o -H newc | \
@@ -435,6 +441,11 @@ prof_proteanos_make_initramfs()
if ${init_created}; then
rm -f init
fi
+ if ! ${boot_created}; then
+ find . -xdev -a \! -path './boot/*' -a \
+ \! -path './prokit/*' -a \! -type d | \
+ xargs rm -f
+ fi
;;
esac
return 1