Skip to content

Commit

Permalink
Merge pull request #5 from JedMeister/buster-dev
Browse files Browse the repository at this point in the history
Buster dev
  • Loading branch information
JedMeister authored Nov 11, 2019
2 parents 26f91ac + 2c02463 commit fee754d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
10 changes: 8 additions & 2 deletions pylib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _install(self, packages, ignore_errors=[], extra_apt_args=[]):
for packages in (high, regular):
if packages:
try:
args = ['install', '--force-yes', '--assume-yes']
args = ['install', '--assume-yes']
args.extend(extra_apt_args)
self.chroot.system("apt-get", *(args + packages))
except executil.ExecError, e:
Expand Down Expand Up @@ -208,17 +208,23 @@ def filesize(path):
def md5sum(path):
return str(hashlib.md5(open(path, 'rb').read()).hexdigest())

def sha256sum(path):
return str(hashlib.sha256(open(path, 'rb').read()).hexdigest())

index = []
for package in os.listdir(packagedir):
path = os.path.join(packagedir, package)
# dl_path would best be calculated; but we don't have access to chroot_path here...
dl_path = os.path.join('var/cache/apt/archives', package)
if path.endswith('.deb'):
control = debinfo.get_control_fields(path)
for field in control.keys():
index.append(field + ": " + control[field])

index.append("Filename: " + path)
index.append("Filename: " + dl_path)
index.append("Size: " + filesize(path))
index.append("MD5sum: " + md5sum(path))
index.append("SHA256: " + sha256sum(path))
index.append("")

return index
Expand Down
5 changes: 2 additions & 3 deletions share/bootstrap.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/make -f
# Copyright (c) TurnKey GNU/Linux - http://www.turnkeylinux.org
# Copyright (c) TurnKey GNU/Linux - https://www.turnkeylinux.org
#
# This file is part of Fab
#
Expand Down Expand Up @@ -28,7 +28,7 @@ POOL ?= $(FAB_PATH)/pools/$(CODENAME)
export FAB_POOL_PATH = $(POOL)

FAB_ARCH = $(shell dpkg --print-architecture)
DEBOOTSTRAP_SUITE ?= generic
DEBOOTSTRAP_SUITE ?= turnkey

# build output path
O ?= build
Expand Down Expand Up @@ -121,7 +121,6 @@ define bootstrap/body
$(BSP)/exclude_spec.py $O/base.spec $O/required.spec > $O/base-excl-req.spec
$(BSP)/debootstrap.py $(FAB_ARCH) $(DEBOOTSTRAP_SUITE) $O/bootstrap `pwd`/$O/repo $O/required.spec $O/base-excl-req.spec

fab-chroot $O/bootstrap --script $(BSP)/cleanup.sh
fab-chroot $O/bootstrap 'echo "do_initrd = Yes" > /etc/kernel-img.conf'
endef

Expand Down
6 changes: 3 additions & 3 deletions share/bootstrap/debootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import os
import sys
from os.path import *

from executil import system
import subprocess

def usage(s=None):
if s: print >> sys.stderr, s
Expand All @@ -24,6 +23,7 @@ def get_packages(spec_file):
for line in file(spec_file).readlines() ]

def main():

args = sys.argv[1:]
if len(args) != 6:
usage()
Expand All @@ -34,7 +34,7 @@ def main():
os.environ["BASE_PACKAGES"] = " ".join(get_packages(base_spec))
repo = abspath(repo)

system("debootstrap --arch %s %s %s file://%s" % (arch, suite, target, repo))
subprocess.check_output(["debootstrap", "--arch", arch, suite, target, "file://"+repo])

if __name__=="__main__":
main()
16 changes: 8 additions & 8 deletions share/product.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ UNIT_DIRS ?= unit.d
CONF_SCRIPTS ?= conf.d
PATCHES_PATH ?= patches.d

INITRAMFS_PACKAGES ?= busybox-initramfs casper
INITRAMFS_PACKAGES ?= busybox live-boot

# build output path
O ?= build
Expand Down Expand Up @@ -437,10 +437,10 @@ cdroot/deps ?= $(STAMPS_DIR)/root.patched $(_CDROOT)
define cdroot/body
if [ -e $O/cdroot ]; then rm -rf $O/cdroot; fi
cp -a $(_CDROOT) $O/cdroot
mkdir $O/cdroot/casper
mkdir $O/cdroot/live
if [ -d $(CDROOT_OVERLAY) ]; then fab-apply-overlay $(CDROOT_OVERLAY) $O/cdroot; fi

$(MKSQUASHFS) $O/root.patched $O/cdroot/casper/10root.squashfs $(MKSQUASHFS_OPTS)
$(MKSQUASHFS) $O/root.patched $O/cdroot/live/10root.squashfs $(MKSQUASHFS_OPTS)
endef

define run-genisoimage
Expand Down Expand Up @@ -475,15 +475,15 @@ define cdroot-dynamic/body
cp $O/root.sandbox/usr/lib/syslinux/modules/bios/libcom32.c32 $O/cdroot/isolinux
cp $O/root.sandbox/usr/lib/syslinux/modules/bios/vesamenu.c32 $O/cdroot/isolinux
cp $O/root.sandbox/usr/lib/syslinux/modules/bios/gfxboot.c32 $O/cdroot/isolinux
cp $O/root.sandbox/boot/$(shell basename $(shell readlink $O/root.sandbox/vmlinuz)) $O/cdroot/casper/vmlinuz
cp $O/root.sandbox/boot/$(shell basename $(shell readlink $O/root.sandbox/initrd.img)) $O/cdroot/casper/initrd.gz
cp $O/root.sandbox/boot/$(shell basename $(shell readlink $O/root.sandbox/vmlinuz)) $O/cdroot/live/vmlinuz
cp $O/root.sandbox/boot/$(shell basename $(shell readlink $O/root.sandbox/initrd.img)) $O/cdroot/live/initrd.gz

rm -f $O/cdroot/casper/20sandbox.squashfs
rm -f $O/cdroot/live/20sandbox.squashfs
@if deck --isdirty $O/root.sandbox; then \
$(call root-cleanup, $O/root.sandbox) \
\
get_last_level="deck --get-level=last $O/root.sandbox"; \
output=$O/cdroot/casper/20sandbox.squashfs; \
output=$O/cdroot/live/20sandbox.squashfs; \
echo "mksquashfs \$$($$get_last_level) $$output"; \
\
last_level=$$($$get_last_level); \
Expand All @@ -504,7 +504,7 @@ define updated-initramfs/body
rm -rf $O/product.iso
$(root.patched/body)
fab-install $$FAB_INSTALL_OPTS $O/root.patched $(INITRAMFS_PACKAGES)
cp $O/root.patched/boot/$(shell basename $(shell readlink $O/root.patched/initrd.img)) $O/cdroot/casper/initrd.gz
cp $O/root.patched/boot/$(shell basename $(shell readlink $O/root.patched/initrd.img)) $O/cdroot/live/initrd.gz
$(run-genisoimage)
endef

Expand Down

0 comments on commit fee754d

Please sign in to comment.