Update pi-gen and prepare for Tradfri

This commit is contained in:
Landrash 2017-04-29 16:52:35 +02:00
commit 056bdab523
29 changed files with 144 additions and 34 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
deploy/*
work/*
config
postrun.sh
SKIP
.pc
*-pc

View File

@ -112,3 +112,4 @@ Then remove the `EXPORT*` files from `./stage4` (if building up to stage 2) or f
$ touch ./stage3/SKIP
$ rm stage3/EXPORT*
```
If you wish to build further configurations upon (for example) the lite system, you can also delete the contents of `./stage3` and `./stage4` and replace with your own contents in the same format.

View File

@ -67,10 +67,10 @@ EOF
./${i}-run.sh
log "End ${SUB_STAGE_DIR}/${i}-run.sh"
fi
if [ -f ${i}-run-chroot ]; then
log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot"
on_chroot < ${i}-run-chroot
log "End ${SUB_STAGE_DIR}/${i}-run-chroot"
if [ -f ${i}-run-chroot.sh ]; then
log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot.sh"
on_chroot < ${i}-run-chroot.sh
log "End ${SUB_STAGE_DIR}/${i}-run-chroot.sh"
fi
done
popd > /dev/null
@ -132,8 +132,8 @@ export IMG_DATE=${IMG_DATE:-"$(date -u +%Y-%m-%d)"}
export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SCRIPT_DIR="${BASE_DIR}/scripts"
export WORK_DIR="${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"
export DEPLOY_DIR="${BASE_DIR}/deploy"
export WORK_DIR=${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}
export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"}
export LOG_FILE="${WORK_DIR}/build.log"
export CLEAN
@ -148,6 +148,8 @@ export PREV_STAGE_DIR
export ROOTFS_DIR
export PREV_ROOTFS_DIR
export IMG_SUFFIX
export NOOBS_NAME
export NOOBS_DESCRIPTION
export EXPORT_DIR
export EXPORT_ROOTFS_DIR
@ -172,13 +174,21 @@ done
CLEAN=1
for EXPORT_DIR in ${EXPORT_DIRS}; do
STAGE_DIR=${BASE_DIR}/export-image
IMG_SUFFIX=$(cat ${EXPORT_DIR}/EXPORT_IMAGE)
source "${EXPORT_DIR}/EXPORT_IMAGE"
EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename ${EXPORT_DIR})/rootfs
run_stage
if [ -e ${EXPORT_DIR}/EXPORT_NOOBS ]; then
source ${EXPORT_DIR}/EXPORT_NOOBS
STAGE_DIR=${BASE_DIR}/export-noobs
run_stage
fi
done
if [ -x postrun.sh ]; then
log "Begin postrun.sh"
cd "${BASE_DIR}"
./postrun.sh
log "End postrun.sh"
fi
log "End ${BASE_DIR}"

View File

@ -0,0 +1,12 @@
#!/bin/bash -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
IMGID="$(fdisk -l ${IMG_FILE} | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p')"
BOOT_PARTUUID="${IMGID}-01"
ROOT_PARTUUID="${IMGID}-02"
sed -i "s/BOOTDEV/PARTUUID=${BOOT_PARTUUID}/" ${ROOTFS_DIR}/etc/fstab
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" ${ROOTFS_DIR}/etc/fstab
sed -i "s/ROOTDEV/PARTUUID=${ROOT_PARTUUID}/" ${ROOTFS_DIR}/boot/cmdline.txt

View File

@ -18,6 +18,29 @@ if [ -e ${ROOTFS_DIR}/etc/ld.so.preload.disabled ]; then
mv ${ROOTFS_DIR}/etc/ld.so.preload.disabled ${ROOTFS_DIR}/etc/ld.so.preload
fi
rm -f ${ROOTFS_DIR}/etc/apt/sources.list~
rm -f ${ROOTFS_DIR}/etc/apt/trusted.gpg~
rm -f ${ROOTFS_DIR}/etc/passwd-
rm -f ${ROOTFS_DIR}/etc/group-
rm -f ${ROOTFS_DIR}/etc/shadow-
rm -f ${ROOTFS_DIR}/etc/gshadow-
rm -f ${ROOTFS_DIR}/var/cache/debconf/*-old
rm -f ${ROOTFS_DIR}/var/lib/dpkg/*-old
rm -f ${ROOTFS_DIR}/usr/share/icons/*/icon-theme.cache
rm -f ${ROOTFS_DIR}/var/lib/dbus/machine-id
true > ${ROOTFS_DIR}/etc/machine-id
for _FILE in $(find ${ROOTFS_DIR}/var/log/ -type f); do
true > ${_FILE}
done
rm -f "${ROOTFS_DIR}/root/.vnc/private.key"
update_issue $(basename ${EXPORT_DIR})
install -m 644 ${ROOTFS_DIR}/etc/rpi-issue ${ROOTFS_DIR}/boot/issue.txt
install files/LICENSE.oracle ${ROOTFS_DIR}/boot/

View File

@ -8,19 +8,19 @@ rm -f ${IMG_FILE}
rm -rf ${ROOTFS_DIR}
mkdir -p ${ROOTFS_DIR}
BOOT_SIZE=$(du -sh ${EXPORT_ROOTFS_DIR}/boot -B M | cut -f 1 | tr -d M)
TOTAL_SIZE=$(du -sh ${EXPORT_ROOTFS_DIR} -B M | cut -f 1 | tr -d M)
BOOT_SIZE=$(du -s ${EXPORT_ROOTFS_DIR}/boot --block-size=1 | cut -f 1)
TOTAL_SIZE=$(du -s ${EXPORT_ROOTFS_DIR} --exclude var/cache/apt/archives --block-size=1 | cut -f 1)
IMG_SIZE=$(expr $BOOT_SIZE \* 2 \+ $TOTAL_SIZE \+ 512)M
IMG_SIZE=$((BOOT_SIZE + TOTAL_SIZE + (400 * 1024 * 1024)))
fallocate -l ${IMG_SIZE} ${IMG_FILE}
fdisk ${IMG_FILE} > /dev/null 2>&1 <<EOF
fdisk -H 255 -S 63 ${IMG_FILE} <<EOF
o
n
8192
+`expr $BOOT_SIZE \* 3`M
+$((BOOT_SIZE * 2 /512))
p
t
c
@ -50,11 +50,11 @@ ROOT_DEV=$(losetup --show -f -o ${ROOT_OFFSET} --sizelimit ${ROOT_LENGTH} ${IMG_
echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH"
echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH"
mkdosfs -n boot -S 512 -s 16 -v $BOOT_DEV > /dev/null
mkdosfs -n boot -F 32 -v $BOOT_DEV > /dev/null
mkfs.ext4 -O ^huge_file $ROOT_DEV > /dev/null
mount -v $ROOT_DEV ${ROOTFS_DIR} -t ext4
mkdir -p ${ROOTFS_DIR}/boot
mount -v $BOOT_DEV ${ROOTFS_DIR}/boot -t vfat
rsync -aHAXx ${EXPORT_ROOTFS_DIR}/ ${ROOTFS_DIR}/
rsync -aHAXx --exclude var/cache/apt/archives ${EXPORT_ROOTFS_DIR}/ ${ROOTFS_DIR}/

View File

@ -5,7 +5,7 @@ NOOBS_DIR="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}"
install -v -m 744 files/partition_setup.sh ${NOOBS_DIR}/
install -v files/partitions.json ${NOOBS_DIR}/
install -v files/os.json ${NOOBS_DIR}/
install -v files/Raspbian.png ${NOOBS_DIR}/
install -v files/OS.png ${NOOBS_DIR}/
install -v files/release_notes.txt ${NOOBS_DIR}/
tar -v -c -C files/marketing -f ${NOOBS_DIR}/marketing.tar .
@ -19,13 +19,18 @@ ROOT_SIZE=$(expr ${ROOT_SIZE} / 1000000 \+ 1)
BOOT_NOM=$(expr ${BOOT_SIZE} \* 3)
ROOT_NOM=$(expr ${ROOT_SIZE} \+ 400)
mv "${NOOBS_DIR}/OS.png" "${NOOBS_DIR}/$(echo ${NOOBS_NAME} | sed 's/ /_/g').png"
sed ${NOOBS_DIR}/partitions.json -i -e "s|BOOT_SIZE|${BOOT_SIZE}|"
sed ${NOOBS_DIR}/partitions.json -i -e "s|ROOT_SIZE|${ROOT_SIZE}|"
sed ${NOOBS_DIR}/partitions.json -i -e "s|BOOT_NOM|${BOOT_NOM}|"
sed ${NOOBS_DIR}/partitions.json -i -e "s|ROOT_NOM|${ROOT_NOM}|"
sed ${NOOBS_DIR}/release_notes.txt -i -e "s|UNRELEASED|${IMG_DATE}|"
sed ${NOOBS_DIR}/os.json -i -e "s|UNRELEASED|${IMG_DATE}|"
sed ${NOOBS_DIR}/os.json -i -e "s|NOOBS_NAME|${NOOBS_NAME}|"
sed ${NOOBS_DIR}/os.json -i -e "s|NOOBS_DESCRIPTION|${NOOBS_DESCRIPTION}|"
sed ${NOOBS_DIR}/release_notes.txt -i -e "s|UNRELEASED|${IMG_DATE}|"
cp -a ${NOOBS_DIR} ${DEPLOY_DIR}/

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,8 +1,8 @@
{
"description": "A community-created port of Debian jessie for the Raspberry Pi",
"description": "NOOBS_DESCRIPTION",
"feature_level": 35120124,
"kernel": "4.4",
"name": "Raspbian",
"name": "NOOBS_NAME",
"password": "raspberry",
"release_date": "UNRELEASED",
"supported_hex_revisions": "2,3,4,5,6,7,8,9,d,e,f,10,11,12,14,19,1040,1041,0092,0093,2082",

View File

@ -12,10 +12,22 @@ mkdir -p /tmp/1 /tmp/2
mount "$part1" /tmp/1
mount "$part2" /tmp/2
sed /tmp/1/cmdline.txt -i -e "s|root=/dev/[^ ]*|root=${part2}|"
sed /tmp/1/cmdline.txt -i -e "s|root=[^ ]*|root=${part2}|"
sed /tmp/2/etc/fstab -i -e "s|^.* / |${part2} / |"
sed /tmp/2/etc/fstab -i -e "s|^.* /boot |${part1} /boot |"
if [ -f /mnt/ssh ]; then
cp /mnt/ssh /tmp/1/
fi
if [ -f /mnt/ssh.txt ]; then
cp /mnt/ssh.txt /tmp/1/
fi
if [ -f /settings/wpa_supplicant.conf ]; then
cp /settings/wpa_supplicant.conf /tmp/1/
fi
if ! grep -q resize /proc/cmdline; then
sed -i 's| quiet init=/usr/lib/raspi-config/init_resize.sh||' /tmp/1/cmdline.txt
fi

View File

@ -3,6 +3,7 @@
{
"filesystem_type": "FAT",
"label": "boot",
"mkfs_options": "-F 32",
"partition_size_nominal": BOOT_NOM,
"uncompressed_tarball_size": BOOT_SIZE,
"want_maximised": false

View File

@ -1,4 +1,27 @@
UNRELEASED:
* Wolfram Mathematica updated to version 11.0.1
* Adobe Flash Player updated to version 25.0.0.127
* Use PARTUUID to support USB boot
2017-03-02:
* Updated kernel and firmware (final Pi Zero W support)
* Wolfram Mathematica updated to version 11
* NOOBS installs now checks for presence of 'ssh' file on the NOOBS partition.
2017-02-16:
* Chromium browser updated to version 56
* Adobe Flash Player updated to version 24.0.0.221
* RealVNC Server and Viewer updated to version 6.0.2 (RealVNC Connect)
* Sonic Pi updated to version 2.11
* Node-RED updated to version 0.15.3
* Scratch updated to version 120117
* Detection of SSH enabled with default password moved into PAM
* Updated desktop GL driver to support use of fake KMS option
* Raspberry Pi Configuration and raspi-config allow setting of fixed HDMI resolution
* raspi-config allows enabling of serial hardware independent of serial terminal
* Updates to kernel and firmware
* Various minor bug fixes and usability and appearance tweaks
2017-01-11:
* Re-release of the 2016-11-25 image with a FAT32-formatted boot partition
2016-11-25:
* SSH disabled by default; can be enabled by creating a file with name "ssh" in boot partition
* Prompt for password change at boot when SSH enabled with default password unchanged
* Adobe Flash Player included

View File

@ -28,7 +28,7 @@ copy_previous(){
false
fi
mkdir -p "${ROOTFS_DIR}"
rsync -aHAXx "${PREV_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
rsync -aHAXx --exclude var/cache/apt/archives "${PREV_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
}
export -f copy_previous

View File

@ -1 +1 @@
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

View File

@ -1,5 +1,5 @@
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# http://rpf.io/configtxtreadme
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode

View File

@ -1,3 +1,3 @@
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
BOOTDEV /boot vfat defaults 0 2
ROOTDEV / ext4 defaults,noatime 0 1

View File

@ -5,8 +5,7 @@ console-setup console-setup/charmap47 select UTF-8
# Choices: . Arabic, # Armenian, # Cyrillic - KOI8-R and KOI8-U, # Cyrillic - non-Slavic languages, # Cyrillic - Slavic languages (also Bosnian and Serbian Latin), . Ethiopic, # Georgian, # Greek, # Hebrew, # Lao, # Latin1 and Latin5 - western Europe and Turkic languages, # Latin2 - central Europe and Romanian, # Latin3 and Latin8 - Chichewa; Esperanto; Irish; Maltese and Welsh, # Latin7 - Lithuanian; Latvian; Maori and Marshallese, . Latin - Vietnamese, # Thai, . Combined - Latin; Slavic Cyrillic; Hebrew; basic Arabic, . Combined - Latin; Slavic Cyrillic; Greek, . Combined - Latin; Slavic and non-Slavic Cyrillic, Guess optimal character set
console-setup console-setup/codeset47 select Guess optimal character set
# Font for the console:
# Choices: Fixed, Goha, GohaClassic, Terminus, TerminusBold, TerminusBoldVGA, VGA, Do not change the boot/kernel font, Let the
system select a suitable font
# Choices: Fixed, Goha, GohaClassic, Terminus, TerminusBold, TerminusBoldVGA, VGA, Do not change the boot/kernel font, Let the system select a suitable font
console-setup console-setup/fontface47 select Do not change the boot/kernel font
# Geographic area:
# Choices: Africa, America, Antarctica, Australia, Arctic Ocean, Asia, Atlantic Ocean, Europe, Indian Ocean, Pacific Ocean, System V timezones, US, None of the above

View File

@ -15,3 +15,4 @@ pi-bluetooth
apt-listchanges
usb-modeswitch
apt-transport-https
libpam-chksshpwd

View File

@ -1,5 +1,5 @@
--- a/rootfs/boot/cmdline.txt
+++ b/rootfs/boot/cmdline.txt
@@ -1 +1 @@
-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
-dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
+dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=ROOTDEV rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh

View File

@ -9,6 +9,7 @@ install -m 644 files/ttyoutput.conf ${ROOTFS_DIR}/etc/systemd/system/rc-local.
install -m 644 files/50raspi ${ROOTFS_DIR}/etc/apt/apt.conf.d/
install -m 644 files/console-setup ${ROOTFS_DIR}/etc/default/
on_chroot << EOF
systemctl disable hwclock.sh

View File

@ -0,0 +1,16 @@
# CONFIGURATION FILE FOR SETUPCON
# Consult the console-setup(5) manual page.
ACTIVE_CONSOLES="/dev/tty[1-6]"
CHARMAP="UTF-8"
CODESET="guess"
FONTFACE=""
FONTSIZE=""
VIDEOMODE=
# The following is an example how to use a braille font
# FONT='lat9w-08.psf.gz brl-8x8.psf'

View File

@ -12,7 +12,7 @@
case "$1" in
start)
log_daemon_msg "Starting resize2fs_once"
ROOT_DEV=`grep -Eo 'root=[[:graph:]]+' /proc/cmdline | cut -d '=' -f 2-` &&
ROOT_DEV=$(findmnt / -o source -n) &&
resize2fs $ROOT_DEV &&
update-rc.d resize2fs_once remove &&
rm /etc/init.d/resize2fs_once &&

View File

@ -1,5 +0,0 @@
#!/bin/bash -e
on_chroot << EOF
apt-get clean
EOF

View File

@ -0,0 +1,2 @@
# Do you accept the Wolfram - Raspberry Pi® Bundle License Agreement?
wolfram-engine shared/accepted-wolfram-eula boolean true

View File

@ -0,0 +1 @@
wolfram-engine

1
stage5/EXPORT_IMAGE Normal file
View File

@ -0,0 +1 @@
IMG_SUFFIX=""

2
stage5/EXPORT_NOOBS Normal file
View File

@ -0,0 +1,2 @@
NOOBS_NAME="Raspbian with PIXEL"
NOOBS_DESCRIPTION="A port of Debian jessie for the Raspberry Pi (full desktop version)"

4
stage5/prerun.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash -e
if [ ! -d ${ROOTFS_DIR} ]; then
copy_previous
fi