mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-16 05:11:31 +00:00
Imported 2.704
No reason for CPC update specified.
This commit is contained in:
parent
204c84b308
commit
1cc9fe8f97
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
|||||||
|
livecd-rootfs (2.704) hirsute; urgency=medium
|
||||||
|
|
||||||
|
* riscv64: build preinstalled riscv64 image with uboot SPL and CIDATA.
|
||||||
|
|
||||||
|
-- Dimitri John Ledkov <xnox@ubuntu.com> Tue, 01 Dec 2020 17:16:03 +0000
|
||||||
|
|
||||||
livecd-rootfs (2.703) hirsute; urgency=medium
|
livecd-rootfs (2.703) hirsute; urgency=medium
|
||||||
|
|
||||||
* Do not hard-code the UC20 amd64 image size as now ubuntu-image should be
|
* Do not hard-code the UC20 amd64 image size as now ubuntu-image should be
|
||||||
|
@ -819,6 +819,11 @@ case $PROJECT in
|
|||||||
arm64)
|
arm64)
|
||||||
add_package install flash-kernel
|
add_package install flash-kernel
|
||||||
;;
|
;;
|
||||||
|
riscv64)
|
||||||
|
if [ -n "$SUBARCH" ]; then
|
||||||
|
KERNEL_FLAVOURS=generic
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
OPTS="${OPTS:+$OPTS }--system=normal"
|
OPTS="${OPTS:+$OPTS }--system=normal"
|
||||||
OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs"
|
OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs"
|
||||||
|
8
live-build/cidata/meta-data.sample
Normal file
8
live-build/cidata/meta-data.sample
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# NB! This is a sample, copy to "meta-data" and mofiy to take effect
|
||||||
|
# NB! Also see user-data.sample and network-config.sample
|
||||||
|
|
||||||
|
# This is the meta-data configuration file for cloud-init. Typically this just
|
||||||
|
# contains the instance_id. Please refer to the cloud-init documentation for
|
||||||
|
# more information:
|
||||||
|
#
|
||||||
|
# https://cloudinit.readthedocs.io/
|
52
live-build/cidata/network-config.sample
Normal file
52
live-build/cidata/network-config.sample
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# NB! This is a sample, copy to "network-config" and mofiy to take effect
|
||||||
|
# NB! Also see user-data.sample and meta-data.sample
|
||||||
|
|
||||||
|
# This file contains a netplan-compatible configuration which cloud-init will
|
||||||
|
# apply on first-boot (note: it will *not* update the config after the first
|
||||||
|
# boot). Please refer to the cloud-init documentation and the netplan reference
|
||||||
|
# for full details:
|
||||||
|
#
|
||||||
|
# https://cloudinit.readthedocs.io/en/latest/topics/network-config.html
|
||||||
|
# https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html
|
||||||
|
# https://netplan.io/reference
|
||||||
|
#
|
||||||
|
# Please note that the YAML format employed by this file is sensitive to
|
||||||
|
# differences in whitespace; if you are editing this file in an editor (like
|
||||||
|
# Notepad) which uses literal tabs, take care to only use spaces for
|
||||||
|
# indentation. See the following link for more details:
|
||||||
|
#
|
||||||
|
# https://en.wikipedia.org/wiki/YAML
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# The image has stock nocloud-net configuration that will attemp dhcp
|
||||||
|
# v4 on all ethernet devices, similar to zz-all-en / zz-all-eth
|
||||||
|
# stanzas below. Hence this file is optional.
|
||||||
|
#
|
||||||
|
#version: 2
|
||||||
|
#ethernets:
|
||||||
|
# zz-all-en:
|
||||||
|
# match:
|
||||||
|
# name: "en*"
|
||||||
|
# dhcp4: true
|
||||||
|
# optional: true
|
||||||
|
# zz-all-eth:
|
||||||
|
# match:
|
||||||
|
# name: "eth*"
|
||||||
|
# dhcp4: true
|
||||||
|
# optional: true
|
||||||
|
#wifis:
|
||||||
|
# wlan0:
|
||||||
|
# dhcp4: true
|
||||||
|
# optional: true
|
||||||
|
# access-points:
|
||||||
|
# myhomewifi:
|
||||||
|
# password: "S3kr1t"
|
||||||
|
# myworkwifi:
|
||||||
|
# password: "correct battery horse staple"
|
||||||
|
# workssid:
|
||||||
|
# auth:
|
||||||
|
# key-management: eap
|
||||||
|
# method: peap
|
||||||
|
# identity: "me@example.com"
|
||||||
|
# password: "passw0rd"
|
||||||
|
# ca-certificate: /etc/my_ca.pem
|
84
live-build/cidata/user-data.sample
Normal file
84
live-build/cidata/user-data.sample
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#cloud-config
|
||||||
|
|
||||||
|
# NB! This is a sample, copy to "user-data" and modify to take effect
|
||||||
|
|
||||||
|
# NB! meta-data is required too! See "meta-data.sample"
|
||||||
|
|
||||||
|
# NB! For networking see "network-config.sample"
|
||||||
|
|
||||||
|
# This is the user-data configuration file for cloud-init. This image
|
||||||
|
# has a default nocloud-net metadata available on the first
|
||||||
|
# partition. By default it sets up an initial user called "ubuntu"
|
||||||
|
# with password "ubuntu", which must be changed at first
|
||||||
|
# login. However, one can override and provide many additional actions
|
||||||
|
# to be initiated on first boot from this file. The cloud-init
|
||||||
|
# documentation has more details: https://cloudinit.readthedocs.io/
|
||||||
|
# Some additional examples are provided in comments below the default
|
||||||
|
# configuration.
|
||||||
|
|
||||||
|
# On first boot, set the (default) ubuntu user's password to "ubuntu" and
|
||||||
|
# expire user passwords
|
||||||
|
#chpasswd:
|
||||||
|
# expire: true
|
||||||
|
# list:
|
||||||
|
# - ubuntu:ubuntu
|
||||||
|
|
||||||
|
# Enable password authentication with the SSH daemon
|
||||||
|
#ssh_pwauth: true
|
||||||
|
|
||||||
|
## On first boot, use ssh-import-id to give the specific users SSH access to
|
||||||
|
## the default user
|
||||||
|
#ssh_import_id:
|
||||||
|
#- lp:my_launchpad_username
|
||||||
|
#- gh:my_github_username
|
||||||
|
|
||||||
|
## Add users and groups to the system, and import keys with the ssh-import-id
|
||||||
|
## utility
|
||||||
|
#groups:
|
||||||
|
#- robot: [robot]
|
||||||
|
#- robotics: [robot]
|
||||||
|
#
|
||||||
|
#users:
|
||||||
|
#- default
|
||||||
|
#- name: robot
|
||||||
|
# gecos: Mr. Robot
|
||||||
|
# primary_group: robot
|
||||||
|
# groups: users
|
||||||
|
# ssh_import_id: foobar
|
||||||
|
# lock_passwd: false
|
||||||
|
# passwd: $5$hkui88$nvZgIle31cNpryjRfO9uArF7DYiBcWEnjqq7L1AQNN3
|
||||||
|
|
||||||
|
## Update apt database and upgrade packages on first boot
|
||||||
|
#package_update: true
|
||||||
|
#package_upgrade: true
|
||||||
|
|
||||||
|
## Install additional packages on first boot
|
||||||
|
#packages:
|
||||||
|
#- pwgen
|
||||||
|
#- pastebinit
|
||||||
|
#- [libpython2.7, 2.7.3-0ubuntu3.1]
|
||||||
|
|
||||||
|
## Write arbitrary files to the file-system (including binaries!)
|
||||||
|
#write_files:
|
||||||
|
#- path: /etc/default/keyboard
|
||||||
|
# content: |
|
||||||
|
# # KEYBOARD configuration file
|
||||||
|
# # Consult the keyboard(5) manual page.
|
||||||
|
# XKBMODEL="pc105"
|
||||||
|
# XKBLAYOUT="gb"
|
||||||
|
# XKBVARIANT=""
|
||||||
|
# XKBOPTIONS="ctrl: nocaps"
|
||||||
|
# permissions: '0644'
|
||||||
|
# owner: root:root
|
||||||
|
#- encoding: gzip
|
||||||
|
# path: /usr/bin/hello
|
||||||
|
# content: !!binary |
|
||||||
|
# H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
|
||||||
|
# owner: root:root
|
||||||
|
# permissions: '0755'
|
||||||
|
|
||||||
|
## Run arbitrary commands at rc.local like time
|
||||||
|
#runcmd:
|
||||||
|
#- [ ls, -l, / ]
|
||||||
|
#- [ sh, -xc, "echo $(date) ': hello world!'" ]
|
||||||
|
#- [ wget, "http://ubuntu.com", -O, /run/mydir/index.html ]
|
@ -989,6 +989,19 @@ is_live_layer () {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_cidata() {
|
||||||
|
local cidata_dev=$1
|
||||||
|
local mountpoint=$(mktemp -d)
|
||||||
|
mkfs.vfat -F 32 -n CIDATA ${cidata_dev}
|
||||||
|
mount ${cidata_dev} ${mountpoint}
|
||||||
|
cp /usr/share/livecd-rootfs/live-build/cidata/* ${mountpoint}
|
||||||
|
cat >>${mountpoint}/meta-data.sample <<END
|
||||||
|
#instance-id: iid-$(openssl rand -hex 8)
|
||||||
|
|
||||||
|
END
|
||||||
|
umount ${mountpoint}
|
||||||
|
}
|
||||||
|
|
||||||
replace_kernel () {
|
replace_kernel () {
|
||||||
mountpoint=$1
|
mountpoint=$1
|
||||||
new_kernel=$2
|
new_kernel=$2
|
||||||
|
@ -21,6 +21,10 @@ case ${PROJECT:-} in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ "$ARCH" = "riscv64" ] && [ -n "${SUBARCH:-}" ]; then
|
||||||
|
IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2), due to linux-generic instead of virtual
|
||||||
|
fi
|
||||||
|
|
||||||
. config/binary
|
. config/binary
|
||||||
|
|
||||||
. config/functions
|
. config/functions
|
||||||
@ -38,18 +42,34 @@ create_partitions() {
|
|||||||
riscv64)
|
riscv64)
|
||||||
# same as arm64/armhf, but set bit 2 legacy bios bootable
|
# same as arm64/armhf, but set bit 2 legacy bios bootable
|
||||||
# on the first partition for uboot
|
# on the first partition for uboot
|
||||||
sgdisk "${disk_image}" \
|
# and have two loader partitions of uboot SPL & real one
|
||||||
--set-alignment=2 \
|
# and have CIDATA partition for preinstalled image
|
||||||
--new=13:34:2081 \
|
if [ -z "${SUBARCH:-}" ]; then
|
||||||
--change-name=13:loader1 \
|
# cloud-image
|
||||||
--typecode=13:5B193300-FC78-40CD-8002-E86C45580B47 \
|
sgdisk "${disk_image}" \
|
||||||
--new=14:2082:10273 \
|
--set-alignment=2 \
|
||||||
--change-name=14:loader2 \
|
--new=15::+106M \
|
||||||
--typecode=14:2E54B353-1271-4842-806F-E436D6AF6985 \
|
--typecode=15:ef00 \
|
||||||
--new=15::+106M\
|
--new=1:: \
|
||||||
--typecode=15:ef00 \
|
--attributes=1:set:2
|
||||||
--new=1:: \
|
else
|
||||||
--attributes=1:set:2
|
# preinstalled server, currently FU540
|
||||||
|
# FU740 too in the future
|
||||||
|
sgdisk "${disk_image}" \
|
||||||
|
--set-alignment=2 \
|
||||||
|
--new=13:34:2081 \
|
||||||
|
--change-name=13:loader1 \
|
||||||
|
--typecode=13:5B193300-FC78-40CD-8002-E86C45580B47 \
|
||||||
|
--new=14:2082:10273 \
|
||||||
|
--change-name=14:loader2 \
|
||||||
|
--typecode=14:2E54B353-1271-4842-806F-E436D6AF6985 \
|
||||||
|
--new=15::+106M \
|
||||||
|
--typecode=15:ef00 \
|
||||||
|
--new=12::+4M \
|
||||||
|
--change-name=12:CIDATA \
|
||||||
|
--new=1:: \
|
||||||
|
--attributes=1:set:2
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
amd64)
|
amd64)
|
||||||
sgdisk "${disk_image}" \
|
sgdisk "${disk_image}" \
|
||||||
@ -109,47 +129,55 @@ install_grub() {
|
|||||||
efi_target=x86_64-efi
|
efi_target=x86_64-efi
|
||||||
;;
|
;;
|
||||||
riscv64)
|
riscv64)
|
||||||
# TODO does not exist yet on riscv64
|
# TODO grub-efi-riscv64 does not exist yet on riscv64
|
||||||
chroot mountpoint apt-get install -qqy u-boot-menu u-boot-sifive #grub-efi-riscv64
|
chroot mountpoint apt-get install -qqy u-boot-menu #grub-efi-riscv64
|
||||||
efi_target=riscv64-efi
|
efi_target=riscv64-efi
|
||||||
|
|
||||||
chroot mountpoint u-boot-update
|
chroot mountpoint u-boot-update
|
||||||
|
|
||||||
# FSBL, which gets U-Boot SPL
|
if [ -n "${SUBARCH:-}" ]; then
|
||||||
loader1="/dev/mapper${loop_device///dev/}p13"
|
chroot mountpoint apt-get install -qqy u-boot-sifive
|
||||||
# The real U-Boot
|
dd if=mountpoint/usr/lib/u-boot/sifive_fu540/u-boot-spl.bin of=$loader1
|
||||||
loader2="/dev/mapper${loop_device///dev/}p14"
|
dd if=mountpoint/usr/lib/u-boot/sifive_fu540/u-boot.itb of=$loader2
|
||||||
|
# FSBL, which gets U-Boot SPL
|
||||||
dd if=mountpoint/usr/lib/u-boot/sifive_fu540/u-boot-spl.bin of=$loader1
|
loader1="/dev/mapper${loop_device///dev/}p13"
|
||||||
dd if=mountpoint/usr/lib/u-boot/sifive_fu540/u-boot.itb of=$loader2
|
# The real U-Boot
|
||||||
|
loader2="/dev/mapper${loop_device///dev/}p14"
|
||||||
# Provide nocloud datasource
|
# Provide end-user modifyable CIDATA
|
||||||
# Allow interactive login on baremetal SiFive board,
|
cidata_dev="/dev/mapper${loop_device///dev/}p12"
|
||||||
# without a cloud datasource.
|
setup_cidata "${cidata_dev}"
|
||||||
mkdir -p mountpoint/var/lib/cloud/seed/nocloud
|
# Provide stock nocloud datasource
|
||||||
touch mountpoint/var/lib/cloud/seed/nocloud/meta-data
|
# Allow interactive login on baremetal SiFive board,
|
||||||
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud/user-data
|
# without a cloud datasource.
|
||||||
|
mkdir -p mountpoint/var/lib/cloud/seed/nocloud-net
|
||||||
|
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud-net/meta-data
|
||||||
|
instance-id: iid-$(openssl rand -hex 8)
|
||||||
|
END
|
||||||
|
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud-net/user-data
|
||||||
#cloud-config
|
#cloud-config
|
||||||
chpasswd:
|
chpasswd:
|
||||||
expire: false
|
expire: True
|
||||||
list:
|
list:
|
||||||
- ubuntu:ubuntu
|
- ubuntu:ubuntu
|
||||||
|
ssh_pwauth: True
|
||||||
EOF
|
EOF
|
||||||
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud/network-data
|
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud-net/network-config
|
||||||
# This is the initial network config.
|
# This is the initial network config.
|
||||||
# It can be overwritten by cloud-init.
|
# It can be overwritten by cloud-init.
|
||||||
network:
|
version: 2
|
||||||
version: 2
|
ethernets:
|
||||||
ethernets:
|
zz-all-en:
|
||||||
zz-all-en:
|
match:
|
||||||
match:
|
name: "en*"
|
||||||
name: "en*"
|
dhcp4: true
|
||||||
dhcp4: true
|
optional: true
|
||||||
zz-all-eth:
|
zz-all-eth:
|
||||||
match:
|
match:
|
||||||
name: "eth*"
|
name: "eth*"
|
||||||
dhcp4: true
|
dhcp4: true
|
||||||
|
optional: true
|
||||||
EOF
|
EOF
|
||||||
|
fi
|
||||||
## TODO remove below once we have grub-efi-riscv64
|
## TODO remove below once we have grub-efi-riscv64
|
||||||
rm mountpoint/tmp/device.map
|
rm mountpoint/tmp/device.map
|
||||||
umount mountpoint/boot/efi
|
umount mountpoint/boot/efi
|
||||||
|
@ -7,6 +7,10 @@ case $ARCH:$SUBARCH in
|
|||||||
xz -T4 -c binary/boot/disk.ext4 > livecd.ubuntu-cpc.disk1.img.xz
|
xz -T4 -c binary/boot/disk.ext4 > livecd.ubuntu-cpc.disk1.img.xz
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
riscv64:*)
|
||||||
|
xz -T4 -c binary/boot/disk-uefi.ext4 > livecd.ubuntu-cpc.disk1.img.xz
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
. config/functions
|
. config/functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user