first tweaks for multi-arch support

This commit is contained in:
toby 2019-01-07 19:22:40 +00:00
parent 60f3e05571
commit f8f79ca42d
2 changed files with 9 additions and 8 deletions

View File

@ -3,6 +3,7 @@ pipeline:
image: registry.i.wit.com/toby/packager:1.3
commands:
- echo "wit-pxeboot (1.0.$(date +%Y.%m.%d.%H.%M)) unstable; urgency=low\n\n$(git log --format=" * %s")\n\n -- wit <netops@wit.com> $(date -R)" >debian/changelog
- export ARCH=amd64
- ./create_pxeinitrd.sh
- dpkg-buildpackage --no-sign
- ls -lha ../wit-pxeboot_*_all.deb

View File

@ -14,9 +14,8 @@ HOSTNAME=localhost
# Configs overwritable via environment variables
RELEASE=${RELEASE:=unstable}
FLAVOUR=${FLAVOUR:=debian} # Either 'debian' or 'ubuntu'
INCLUDES=${INCLUDES:="openssh-server,init,curl,parted,xz-utils,vim,locales-all,less,dmidecode,iputils-ping,fping,tcpdump,rsync,ethtool,lldpd,iproute2,net-tools,sudo,gnupg,tcpdump,mtr-tiny,ifupdown,ipmitool,iptables,telnet,netcat,bridge-utils,vlan,ifstat,ncurses-term,wget,pciutils,dhcpcd5,python,efibootmgr"}
INCLUDES=${INCLUDES:="openssh-server,init,curl,parted,xz-utils,vim,locales-all,less,dmidecode,iputils-ping,fping,tcpdump,rsync,ethtool,lldpd,iproute2,net-tools,sudo,gnupg,tcpdump,mtr-tiny,ifupdown,ipmitool,iptables,telnet,netcat,bridge-utils,vlan,ifstat,ncurses-term,wget,pciutils,dhcpcd5,python,efibootmgr,busybox-static"}
MIRROR=${MIRROR:="https://mirrors.wit.com/debian"}
ARCH=${ARCH:=amd64}
fail() {
@ -70,9 +69,6 @@ LANG=C DEBIAN_FRONTEND=noninteractive chroot $MNT_DIR apt-get clean
cat /dev/null > $MNT_DIR/etc/machine-id
sed -i '/PasswordAuthentication/d' $MNT_DIR/etc/ssh/sshd_config
echo "PasswordAuthentication no" >>$MNT_DIR/etc/ssh/sshd_config
mkdir -p $MNT_DIR/root/.ssh
echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDd7rLlS1NmTpBr5KP5ryuA/euGD8I6uc2RCg4sCIlvH0FhEPb123QuMVImHi23ftVP61cKZXm8MlTtAoLHduYtGMHCkJWAAkiIpPetAP2KPIpuadtgIS8xuD/TCYjl0xNXLh0M1C7i7HOnTd8yr+3QNjUppyDdKjLvMQbPWZZTU5rt7CYoGlrxHjieCkq9jj8kRjRARUaAJ4DHEgMFUDIcq3JYluzzkgPK/JFwoq/IokVQCr5qfQRwr3SCkD4sIuGTj+J67uzabIr/xDBqlrMW3T+7YfY12ciHpijob+l7xESkJ+6Gxh56z8llBkGiVyh3UqnmW4MvfuAA/D3Dzhwr afrank@adams-mbp.lan > $MNT_DIR/root/.ssh/authorized_keys
@ -156,7 +152,7 @@ cat $MNT_DIR/root/.ssh/id_rsa.pub
mkdir -p $INITRD_DIR/bin
wget -O $INITRD_DIR/bin/busybox https://www.busybox.net/downloads/binaries/1.26.1-defconfig-multiarch/busybox-x86_64
cp $MNT_DIR/bin/busybox $INITRD_DIR/bin/busybox
chmod +x $INITRD_DIR/bin/busybox
cat <<-"EOF" >$INITRD_DIR/init
@ -185,7 +181,6 @@ cat <<-"EOF" >$INITRD_DIR/init
mount -t devpts devpts /dev/pts
# Populate /dev
echo /bin/mdev > /proc/sys/kernel/hotplug
mdev -s
mkdir -p /newroot
@ -205,7 +200,12 @@ chmod +x $INITRD_DIR/init
tar -cJf $INITRD_DIR/rootfs.tar.xz -C $MNT_DIR .
cp $MNT_DIR/boot/vmlinuz-* $RESULT_DIR/vmlinuz
[ -d /usr/lib/linux-image-* ] && cp -r newroot/usr/lib/linux-image-* $RESULT_DIR/dtbs
rm $MNT_DIR/boot/initrd.img-*
mv $MNT_DIR/boot/vmlinuz-* $RESULT_DIR/
ln -s $RESULT_DIR/vmlinuz-* $RESULT_DIR/vmlinuz
cd $INITRD_DIR
find . -print0 | cpio --null -ov --format=newc | gzip -9 > $RESULT_DIR/initramfs.gz