X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail.wtbts.no (mail.wtbts.no [213.234.126.131]) by mail.alpinelinux.org (Postfix) with ESMTP id 7D3CDDC1637 for ; Fri, 30 Dec 2011 10:10:41 +0000 (UTC) Received: from localhost (bsna.nor.wtbts.net [127.0.0.1]) by mail.wtbts.no (Postfix) with ESMTP id 9402EAE4002; Fri, 30 Dec 2011 10:10:40 +0000 (UTC) X-Virus-Scanned: Yes Received: from mail.wtbts.no ([127.0.0.1]) by localhost (bsna.nor.wtbts.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FIEEk5YLtvwD; Fri, 30 Dec 2011 10:10:38 +0000 (UTC) Received: from mail.ytre.org (extmail.nor.wtbts.net [10.65.72.14]) by mail.wtbts.no (Postfix) with ESMTP id E5229AE4001; Fri, 30 Dec 2011 10:10:37 +0000 (UTC) Received: from mail.ytre.org (localhost [127.0.0.1]) by mail.ytre.org (Postfix) with ESMTP id A81DD60AF5D12; Fri, 30 Dec 2011 10:10:37 +0000 (UTC) Received: from ncopa-desktop.nor.wtbts.net (ncopa-desktop.nor.wtbts.net [10.65.65.1]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ncopa@ytre.org) by mail.ytre.org (Postfix) with ESMTPSA id 8225560AF5718; Fri, 30 Dec 2011 10:10:37 +0000 (UTC) Date: Fri, 30 Dec 2011 11:10:37 +0100 From: Natanael Copa To: Roger Pau Monne Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH v2] alpine-iso: add support to create Xen Dom0 LiveCD/USB Message-ID: <20111230111037.4067e953@ncopa-desktop.nor.wtbts.net> In-Reply-To: <1325186298-1945-1-git-send-email-roger.pau@entel.upc.edu> References: <1325186298-1945-1-git-send-email-roger.pau@entel.upc.edu> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; x86_64-unknown-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 29 Dec 2011 20:18:18 +0100 Roger Pau Monne wrote: > A new profile has been added, called alpine-xen, that shoud be used > when trying to craft a Xen Dom0 LiveCD/USB. > > Changes since v1: > > * Removed dummy net setup, since xencommons doesn't need net to > start. > > Please review and comment. Nice! In general, the Makefile is getting bigger and messier. We need to do something to split it up. We should try avoid having profile specifics in main Makefile and try avoid if/else in Makefile. (that is meant for myself as well) > --- > Makefile | 64 > ++++++++++++++++++++++++++++++++++++++++++++++++++- > alpine-xen.conf.mk | 4 +++ alpine-xen.packages | 10 ++++++++ > 3 files changed, 77 insertions(+), 1 deletions(-) > create mode 100644 alpine-xen.conf.mk > create mode 100644 alpine-xen.packages > > diff --git a/Makefile b/Makefile > index 7fa36b2..65a7dd0 100755 > --- a/Makefile > +++ b/Makefile > @@ -200,6 +200,44 @@ $(VSTEMPLATE): > @cd $(VSTEMPLATE_DIR) && $(TAR) -jcf $@ * > > # > +# apkovl rules > +# > + > +ifdef BUILD_APKOVL > +APKOVL_DEST := $(ISO_DIR)/$(BUILD_APKOVL).apkovl.tar.gz > +APKOVL_DIR := $(DESTDIR)/apkovl_$(BUILD_APKOVL) > +endif Have been thinking of other apkovls too, for for example alpine-desktop. I am not convinced that shipping an iso with apkovl is the prober direction to go though. We have talked about implementing "policy" packages in apk so you could have a "profile" package for different setups. policy pakcages could include some configuration that could be overridden by user. Not sure what the status for that is currently. > + > +# Helper function to link a script to runlevel > + > +rc_add = \ > + @mkdir -p "$(APKOVL_DIR)"/etc/runlevels/"$(2)"; \ > + ln -sf /etc/init.d/"$(1)" I think the helper funciton was pretty elegant :) > "$(APKOVL_DIR)"/etc/runlevels/"$(2)"/"$(1)"; + > +$(ISO_DIR)/xen.apkovl.tar.gz: > + @rm -rf "$(APKOVL_DIR)" > + @mkdir -p "$(APKOVL_DIR)" > + @mkdir -p "$(APKOVL_DIR)"/etc/apk > + @echo "xen udev" >> "$(APKOVL_DIR)"/etc/apk/world > + @echo "xen_netback" >> "$(APKOVL_DIR)"/etc/modules > + @echo "xen_blkback" >> "$(APKOVL_DIR)"/etc/modules > + $(call rc_add,devfs,sysinit) > + $(call rc_add,dmesg,sysinit) > + $(call rc_add,hwclock,boot) > + $(call rc_add,modules,boot) > + $(call rc_add,sysctl,boot) > + $(call rc_add,hostname,boot) > + $(call rc_add,bootmisc,boot) > + $(call rc_add,syslog,boot) > + $(call rc_add,mount-ro,shutdown) > + $(call rc_add,killprocs,shutdown) > + $(call rc_add,savecache,shutdown) > + $(call rc_add,udev,sysinit) > + $(call rc_add,udev-postmount,default) > + $(call rc_add,xencommons,default) > + @cd $(APKOVL_DIR) && $(TAR) -zcf $@ * > + @echo "==> apkovl: built $@" > +# > # ISO rules > # In case we go for shipping apkovls in iso's, we might want keep some files in there too. So we should probably do that in subdirs. hum... need to think about this. > > @@ -223,24 +261,42 @@ $(ISOLINUX_CFG): > @echo "$(SYSLINUX_SERIAL)" >$@ > @echo "timeout 20" >>$@ > @echo "prompt 1" >>$@ > +ifeq ($(PROFILE), alpine-xen) > + @echo "default xen-$(KERNEL_FLAVOR_DEFAULT)" >>$@ > + @for flavor in $(KERNEL_FLAVOR); do \ > + echo "label xen-$$flavor"; \ > + echo " kernel /boot/mboot.c32"; \ > + echo " append /boot/xen.gz --- /boot/$$flavor I wonder if we could/should keep those in $(PROFILE).conf.mk... > alpine_dev=cdrom:iso9660 > modules=loop,squashfs,sd-mod,usb-storage,floppy,sr-mod > modloop=/boot/$$flavor.modloop.squashfs $(BOOT_CONSOLE) > --- /boot/$$flavor.gz"; \ > + done >>$@ > +else > @echo "default $(KERNEL_FLAVOR_DEFAULT)" >>$@ > @for flavor in $(KERNEL_FLAVOR); do \ > echo "label $$flavor"; \ > echo " kernel /boot/$$flavor"; \ > echo " append initrd=/boot/$$flavor.gz ... hmm.. maybe not. The xen structure is pretty different. Looks difficult to put that in alpine-xen.conf.mk. Also, we have the update-extlinux.conf tool. I think we should try fix that tool so it could create isolinux.cfg suitable for iso image. > alpine_dev=cdrom:iso9660 > modules=loop,squashfs,sd-mod,usb-storage,floppy,sr-mod quiet > $(BOOT_CONSOLE)"; \ done >>$@ +endif > $(SYSLINUX_CFG): $(ALL_MODLOOP_DIRSTAMP) > @echo "==> iso: configure syslinux" > @echo "$(SYSLINUX_SERIAL)" >$@ > @echo "timeout 20" >>$@ > @echo "prompt 1" >>$@ > +ifeq ($(PROFILE), alpine-xen) > + @echo "default xen-$(KERNEL_FLAVOR_DEFAULT)" >>$@ > + @for flavor in $(KERNEL_FLAVOR); do \ > + echo "label xen-$$flavor"; \ > + echo " kernel /boot/mboot.c32"; \ > + echo " append /boot/xen.gz --- /boot/$$flavor > alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage > modloop=/boot/$$flavor.modloop.squashfs $(BOOT_CONSOLE) > --- /boot/$$flavor.gz"; \ > + done >>$@ > +else > @echo "default $(KERNEL_FLAVOR_DEFAULT)" >>$@ > @for flavor in $(KERNEL_FLAVOR); do \ > echo "label $$flavor"; \ > echo " kernel /boot/$$flavor"; \ > echo " append initrd=/boot/$$flavor.gz > alpine_dev=usbdisk:vfat modules=loop,squashfs,sd-mod,usb-storage > quiet $(BOOT_CONSOLE)"; \ done >>$@ +endif > > clean-syslinux: > @rm -f $(SYSLINUX_CFG) $(ISOLINUX_CFG) $(ISOLINUX_BIN) > @@ -266,6 +322,12 @@ $(ISO_KERNEL_STAMP): $(MODLOOP_DIRSTAMP) > @mkdir -p $(dir $(ISO_KERNEL)) > @apk fetch $(APK_OPTS) --stdout $(KERNEL_PKGNAME) \ > | $(TAR) -C $(ISO_DIR) -xz boot > +ifeq ($(PROFILE), alpine-xen) > + @apk fetch $(APK_OPTS) --stdout xen \ > + | $(TAR) -C $(ISO_DIR) -xz boot > + @apk fetch $(APK_OPTS) --stdout syslinux \ > + | $(TAR) -xz usr/share/syslinux/mboot.c32 -O > > $(ISO_DIR)/boot/mboot.c32 +endif > @rm -f $(ISO_KERNEL) > @ln -s vmlinuz-$(MODLOOP_KERNEL_RELEASE) $(ISO_KERNEL) > @rm -rf $(ISO_DIR)/.[A-Z]* $(ISO_DIR)/.[a-z]* $(ISO_DIR)/lib hard to do the above without special case for xen. hum... > @@ -281,7 +343,7 @@ $(APKOVL_STAMP): > fi > @touch $@ > > -$(ISOFS_DIRSTAMP): $(ALL_MODLOOP) $(ALL_INITFS) $(ISOLINUX_CFG) > $(ISOLINUX_BIN) $(ALL_ISO_KERNEL) $(ISO_REPOS_DIRSTAMP) > $(APKOVL_STAMP) $(SYSLINUX_CFG) +$(ISOFS_DIRSTAMP): $(ALL_MODLOOP) > $(ALL_INITFS) $(ISOLINUX_CFG) $(ISOLINUX_BIN) $(ALL_ISO_KERNEL) > $(ISO_REPOS_DIRSTAMP) $(APKOVL_STAMP) $(SYSLINUX_CFG) $(APKOVL_DEST) > @echo "$(ALPINE_NAME)-$(ALPINE_RELEASE) $(BUILD_DATE)" \ > > $(ISO_DIR)/.alpine-release > @touch $@ > diff --git a/alpine-xen.conf.mk b/alpine-xen.conf.mk > new file mode 100644 > index 0000000..016db33 > --- /dev/null > +++ b/alpine-xen.conf.mk > @@ -0,0 +1,4 @@ > +ALPINE_NAME := alpine-xen > +MODLOOP_EXTRA := > +KERNEL_FLAVOR := grsec > +BUILD_APKOVL := xen > diff --git a/alpine-xen.packages b/alpine-xen.packages > new file mode 100644 > index 0000000..b1cbd42 > --- /dev/null > +++ b/alpine-xen.packages > @@ -0,0 +1,10 @@ > +bkeymaps > +alpine-base > +alpine-mirrors > +wpa_supplicant > +wireless-tools > +openssl > +tzdata > +xen > +udev > +multipath-tools I think I will apply this and we can think of how to clean it up later. -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---