commnad: add new flag '--linuxfactory=<IP address>'

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I5d84f0cde2123c25f3cbd30c6f500cabaaeac2a9
This commit is contained in:
Dongjin Kim
2024-10-28 10:51:27 +09:00
parent a834dd65df
commit ca1cba0580
3 changed files with 12 additions and 0 deletions

View File

@@ -5,3 +5,9 @@ mkdir -p $(dirname $(realpath -m /etc/resolv.conf))
cat>/etc/resolv.conf<<__EOF
nameserver 127.0.0.53
__EOF
if [ ! "x@@DEFAULT_LINUXFACTORY@@" = "x" ]; then
echo "@@DEFAULT_LINUXFACTORY@@ ppa.linuxfactory.or.kr" >> /etc/hosts
fi
cat /etc/hosts

View File

@@ -439,6 +439,8 @@ do_preinstall() {
DEFAULT_KERNEL_PACKAGE=$(get_kernel_package)
[ ! "x${opt_kernel_package}" = "x" ] && DEFAULT_KERNEL_PACKAGE=${opt_kernel_package}
[ ! "x${opt_linuxfactory}" = "x" ] && DEFAULT_LINUXFACTORY=${opt_linuxfactory}
FIXUPS=`ls -A1 ${rootfs_mnt}${fixups_dir}/*`
for fixup in ${FIXUPS}; do
sed -i \
@@ -451,6 +453,7 @@ do_preinstall() {
-e "s,@@DEFAULT_KERNEL_PACKAGE@@,${DEFAULT_KERNEL_PACKAGE},g" \
-e "s,@@DEFAULT_BOOTSCRIPT_PACKAGE@@,$(get_bootscript_package),g" \
-e "s,@@DEFAULT_MACHINE_NAME@@,$(get_machine_name),g" \
-e "s,@@DEFAULT_LINUXFACTORY@@,${DEFAULT_LINUXFACTORY},g" \
-e "s,@@LINUX_KERNEL_CMDLINE@@,root=UUID=${UUID_ROOT} rootwait ro quiet,g" \
-e "s,@@LINUX_KERNEL_CMDLINE_DEFAULTS@@,$(get_kernel_cmdline_defaults),g" \
-e "s,@@DEFAULT_DEV_BOOT@@,${UUID_BOOT},g" \

View File

@@ -22,6 +22,7 @@ usage() {
echo " --keep-builddir: prevent removing temporary directory"
echo " after building an image."
echo " --kernel: kernel package name to use"
echo " --linuxfactory: alternative server IP address of 'ppa.linuxfactory.or.kr'"
exit 1
}
@@ -47,6 +48,8 @@ for opt in "$@"; do
--keep-builddir)
opt_keep_builddir=true;;
--kernel=*) opt_kernel_package="${opt#*=}";;
--linuxfactory=*)
opt_linuxfactory="${opt#*=}";;
--custom=*)
opt_custom="${opt#*=}";;
--addon-wifi) opt_wifi=true;;