Mail archive
alpine-devel

Re: [alpine-devel] [PATCH] mkinitfs - Modified init script for network boot

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Thu, 2 May 2013 15:04:29 +0200

On Thu, 11 Apr 2013 13:54:16 +0100
Hugo Landau <hlandau_at_devever.net> wrote:

> initramfs-init.in | 166
> ++++++++++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 148 insertions(+), 18 deletions(-)
>

This patch was applied already. I am taking a close look and are cleaning up somethings.

I have a few questions.

> fi
> -else
> +fi
> +if [ -f "$sysroot/etc/.default_boot_services" -o ! -f "$ovl" ]; then
> # add some boot services by default
> rc_add devfs sysinit
> rc_add dmesg sysinit
> _at_@ -525,6 +641,8 @@ else
> rc_add mount-ro shutdown
> rc_add killprocs shutdown
> rc_add savecache shutdown
> +
> + rm -f "$sysroot/etc/.default_boot_services"
> fi

Why is the above hunk needed? Why do we need the /etc/.default_boot_services?
 
> if [ -f $sysroot/etc/fstab ]; then
> _at_@ -570,7 +688,16 @@ ebegin "Installing packages to root filesystem"
> if [ "$KOPT_chart" = yes ]; then
> pkgs="$pkgs acct"
> fi
> -apkflags="--initdb --progress --force --no-network"
> +
> +apkflags="--initdb --progress --force"
> +if [ -z "$ALPINE_REPO" ]; then
> + apkflags="$apkflags --no-network"
> +else
> + # HTTP: convince apk to behave
> + apk add --root $sysroot $repo_opt $apkflags
> + apk update --root $sysroot $repo_opt
> +fi

Why do you need to run an extra apk add there? I suspect it was added to create the initial db.

Does it work if we instead do:

if [ -z "$ALPINE_REPO" ]; then
        apkflags="$apkflags --no-network"
else
        apkflags="$apkflags --update-cache"
fi

The --update-cache/-U option will make apk run 'update' before 'add'.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Thu May 02 2013 - 15:04:29 UTC