allow editing filesystem.squashfs with inject-subiquity-snap
This commit is contained in:
parent
d77b4148ef
commit
168d372e68
|
@ -4,7 +4,8 @@ set -eux
|
||||||
|
|
||||||
cmds=
|
cmds=
|
||||||
interactive=no
|
interactive=no
|
||||||
while getopts ":ic:" opt; do
|
edit_filesystem=no
|
||||||
|
while getopts ":ifc:" opt; do
|
||||||
case "${opt}" in
|
case "${opt}" in
|
||||||
i)
|
i)
|
||||||
interactive=yes
|
interactive=yes
|
||||||
|
@ -12,6 +13,9 @@ while getopts ":ic:" opt; do
|
||||||
c)
|
c)
|
||||||
cmds=$OPTARG
|
cmds=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
f)
|
||||||
|
edit_filesystem=yes
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -89,6 +93,14 @@ cp $SUBIQUITY_SNAP_PATH new_installer/var/lib/snapd/seed/snaps/
|
||||||
mkdir new_iso
|
mkdir new_iso
|
||||||
add_overlay old_iso new_iso
|
add_overlay old_iso new_iso
|
||||||
|
|
||||||
|
if [ "$edit_filesystem" = "yes" ]; then
|
||||||
|
mkdir old_filesystem new_filesystem
|
||||||
|
mount -t squashfs old_iso/casper/filesystem.squashfs old_filesystem
|
||||||
|
add_mount old_filesystem
|
||||||
|
add_overlay old_filesystem new_filesystem
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$cmds" ]; then
|
if [ -n "$cmds" ]; then
|
||||||
bash -c "$cmds"
|
bash -c "$cmds"
|
||||||
fi
|
fi
|
||||||
|
@ -96,6 +108,11 @@ if [ "$interactive" = "yes" ]; then
|
||||||
bash
|
bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$edit_filesystem" = "yes" ]; then
|
||||||
|
rm new_iso/casper/filesystem.squashfs
|
||||||
|
mksquashfs new_filesystem new_iso/casper/filesystem.squashfs
|
||||||
|
fi
|
||||||
|
|
||||||
rm new_iso/casper/installer.squashfs
|
rm new_iso/casper/installer.squashfs
|
||||||
mksquashfs new_installer new_iso/casper/installer.squashfs
|
mksquashfs new_installer new_iso/casper/installer.squashfs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue