From d687acb744ae32cbb7b92b25aecbcf08354458e3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 16 Nov 2018 00:48:44 -0800 Subject: [PATCH] Initial FRCVision commit. --- export-image/prerun.sh | 16 ++++++- stage0/01-locale/00-debconf | 4 +- stage1/01-sys-tweaks/files/fstab | 3 ++ stage2/01-sys-tweaks/00-debconf | 6 +-- stage2/01-sys-tweaks/00-packages | 12 ++--- stage2/01-sys-tweaks/01-run.sh | 46 ++++++++++++++++++- stage2/01-sys-tweaks/files/bash.bashrc | 11 +++++ stage2/01-sys-tweaks/files/bash.logout | 2 + stage2/01-sys-tweaks/files/camera_run | 4 ++ stage2/01-sys-tweaks/files/frc.json | 13 ++++++ stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo | 36 +++++++++++++++ .../01-sys-tweaks/files/raspi-blacklist.conf | 6 +++ stage2/01-sys-tweaks/files/resize2fs_once | 1 + stage2/01-sys-tweaks/files/runCamera | 3 ++ stage2/01-sys-tweaks/files/runInteractive | 10 ++++ stage2/01-sys-tweaks/files/runService | 2 + stage2/02-net-tweaks/01-run.sh | 10 ++++ 17 files changed, 170 insertions(+), 15 deletions(-) create mode 100644 stage2/01-sys-tweaks/files/bash.bashrc create mode 100644 stage2/01-sys-tweaks/files/bash.logout create mode 100755 stage2/01-sys-tweaks/files/camera_run create mode 100644 stage2/01-sys-tweaks/files/frc.json create mode 100644 stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo create mode 100644 stage2/01-sys-tweaks/files/raspi-blacklist.conf create mode 100755 stage2/01-sys-tweaks/files/runCamera create mode 100755 stage2/01-sys-tweaks/files/runInteractive create mode 100755 stage2/01-sys-tweaks/files/runService diff --git a/export-image/prerun.sh b/export-image/prerun.sh index 0ac7181..ed17dbe 100755 --- a/export-image/prerun.sh +++ b/export-image/prerun.sh @@ -48,6 +48,16 @@ ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^ 2'| xargs echo -n \ | cut -d" " -f 4 | tr -d B) +# Loopback crash workaround +# https://github.com/RPi-Distro/pi-gen/issues/104 +#losetup -D +#for i in $(seq 0 5); do +# dd if=/dev/zero of=virtualfs$i bs=1024 count=30720 +# losetup /dev/loop$i virtualfs$i +# losetup -d /dev/loop$i +# rm virtualfs$i +#done + BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}") ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}") echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH" @@ -59,11 +69,13 @@ for FEATURE in metadata_csum 64bit; do ROOT_FEATURES="^$FEATURE,$ROOT_FEATURES" fi done -mkdosfs -n boot -F 32 -v "$BOOT_DEV" > /dev/null +mkdosfs -n boot -F 32 -I -v "$BOOT_DEV" > /dev/null mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$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 --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" +rsync -aHAXx --exclude var/cache/apt/archives --exclude dev --exclude boot "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/" +rsync -aHAx --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/boot/" "${ROOTFS_DIR}/boot/" +rsync -aHAx --exclude var/cache/apt/archives "${EXPORT_ROOTFS_DIR}/dev/" "${ROOTFS_DIR}/dev/" diff --git a/stage0/01-locale/00-debconf b/stage0/01-locale/00-debconf index e9d6348..8251ea3 100644 --- a/stage0/01-locale/00-debconf +++ b/stage0/01-locale/00-debconf @@ -1,6 +1,6 @@ # Locales to be generated: # Choices: All locales, aa_DJ ISO-8859-1, aa_DJ.UTF-8 UTF-8, aa_ER UTF-8, aa_ER@saaho UTF-8, aa_ET UTF-8, af_ZA ISO-8859-1, af_ZA.UTF-8 UTF-8, ak_GH UTF-8, am_ET UTF-8, an_ES ISO-8859-15, an_ES.UTF-8 UTF-8, anp_IN UTF-8, ar_AE ISO-8859-6, ar_AE.UTF-8 UTF-8, ar_BH ISO-8859-6, ar_BH.UTF-8 UTF-8, ar_DZ ISO-8859-6, ar_DZ.UTF-8 UTF-8, ar_EG ISO-8859-6, ar_EG.UTF-8 UTF-8, ar_IN UTF-8, ar_IQ ISO-8859-6, ar_IQ.UTF-8 UTF-8, ar_JO ISO-8859-6, ar_JO.UTF-8 UTF-8, ar_KW ISO-8859-6, ar_KW.UTF-8 UTF-8, ar_LB ISO-8859-6, ar_LB.UTF-8 UTF-8, ar_LY ISO-8859-6, ar_LY.UTF-8 UTF-8, ar_MA ISO-8859-6, ar_MA.UTF-8 UTF-8, ar_OM ISO-8859-6, ar_OM.UTF-8 UTF-8, ar_QA ISO-8859-6, ar_QA.UTF-8 UTF-8, ar_SA ISO-8859-6, ar_SA.UTF-8 UTF-8, ar_SD ISO-8859-6, ar_SD.UTF-8 UTF-8, ar_SS UTF-8, ar_SY ISO-8859-6, ar_SY.UTF-8 UTF-8, ar_TN ISO-8859-6, ar_TN.UTF-8 UTF-8, ar_YE ISO-8859-6, ar_YE.UTF-8 UTF-8, as_IN UTF-8, ast_ES ISO-8859-15, ast_ES.UTF-8 UTF-8, ayc_PE UTF-8, az_AZ UTF-8, be_BY CP1251, be_BY.UTF-8 UTF-8, be_BY@latin UTF-8, bem_ZM UTF-8, ber_DZ UTF-8, ber_MA UTF-8, bg_BG CP1251, bg_BG.UTF-8 UTF-8, bho_IN UTF-8, bn_BD UTF-8, bn_IN UTF-8, bo_CN UTF-8, bo_IN UTF-8, br_FR ISO-8859-1, br_FR.UTF-8 UTF-8, br_FR@euro ISO-8859-15, brx_IN UTF-8, bs_BA ISO-8859-2, bs_BA.UTF-8 UTF-8, byn_ER UTF-8, ca_AD ISO-8859-15, ca_AD.UTF-8 UTF-8, ca_ES ISO-8859-1, ca_ES.UTF-8 UTF-8, ca_ES.UTF-8@valencia UTF-8, ca_ES@euro ISO-8859-15, ca_ES@valencia ISO-8859-15, ca_FR ISO-8859-15, ca_FR.UTF-8 UTF-8, ca_IT ISO-8859-15, ca_IT.UTF-8 UTF-8, cmn_TW UTF-8, crh_UA UTF-8, cs_CZ ISO-8859-2, cs_CZ.UTF-8 UTF-8, csb_PL UTF-8, cv_RU UTF-8, cy_GB ISO-8859-14, cy_GB.UTF-8 UTF-8, da_DK ISO-8859-1, da_DK.UTF-8 UTF-8, de_AT ISO-8859-1, de_AT.UTF-8 UTF-8, de_AT@euro ISO-8859-15, de_BE ISO-8859-1, de_BE.UTF-8 UTF-8, de_BE@euro ISO-8859-15, de_CH ISO-8859-1, de_CH.UTF-8 UTF-8, de_DE ISO-8859-1, de_DE.UTF-8 UTF-8, de_DE@euro ISO-8859-15, de_LI.UTF-8 UTF-8, de_LU ISO-8859-1, de_LU.UTF-8 UTF-8, de_LU@euro ISO-8859-15, doi_IN UTF-8, dv_MV UTF-8, dz_BT UTF-8, el_CY ISO-8859-7, el_CY.UTF-8 UTF-8, el_GR ISO-8859-7, el_GR.UTF-8 UTF-8, en_AG UTF-8, en_AU ISO-8859-1, en_AU.UTF-8 UTF-8, en_BW ISO-8859-1, en_BW.UTF-8 UTF-8, en_CA ISO-8859-1, en_CA.UTF-8 UTF-8, en_DK ISO-8859-1, en_DK.ISO-8859-15 ISO-8859-15, en_DK.UTF-8 UTF-8, en_GB ISO-8859-1, en_GB.ISO-8859-15 ISO-8859-15, en_GB.UTF-8 UTF-8, en_HK ISO-8859-1, en_HK.UTF-8 UTF-8, en_IE ISO-8859-1, en_IE.UTF-8 UTF-8, en_IE@euro ISO-8859-15, en_IN UTF-8, en_NG UTF-8, en_NZ ISO-8859-1, en_NZ.UTF-8 UTF-8, en_PH ISO-8859-1, en_PH.UTF-8 UTF-8, en_SG ISO-8859-1, en_SG.UTF-8 UTF-8, en_US ISO-8859-1, en_US.ISO-8859-15 ISO-8859-15, en_US.UTF-8 UTF-8, en_ZA ISO-8859-1, en_ZA.UTF-8 UTF-8, en_ZM UTF-8, en_ZW ISO-8859-1, en_ZW.UTF-8 UTF-8, eo ISO-8859-3, eo.UTF-8 UTF-8, es_AR ISO-8859-1, es_AR.UTF-8 UTF-8, es_BO ISO-8859-1, es_BO.UTF-8 UTF-8, es_CL ISO-8859-1, es_CL.UTF-8 UTF-8, es_CO ISO-8859-1, es_CO.UTF-8 UTF-8, es_CR ISO-8859-1, es_CR.UTF-8 UTF-8, es_CU UTF-8, es_DO ISO-8859-1, es_DO.UTF-8 UTF-8, es_EC ISO-8859-1, es_EC.UTF-8 UTF-8, es_ES ISO-8859-1, es_ES.UTF-8 UTF-8, es_ES@euro ISO-8859-15, es_GT ISO-8859-1, es_GT.UTF-8 UTF-8, es_HN ISO-8859-1, es_HN.UTF-8 UTF-8, es_MX ISO-8859-1, es_MX.UTF-8 UTF-8, es_NI ISO-8859-1, es_NI.UTF-8 UTF-8, es_PA ISO-8859-1, es_PA.UTF-8 UTF-8, es_PE ISO-8859-1, es_PE.UTF-8 UTF-8, es_PR ISO-8859-1, es_PR.UTF-8 UTF-8, es_PY ISO-8859-1, es_PY.UTF-8 UTF-8, es_SV ISO-8859-1, es_SV.UTF-8 UTF-8, es_US ISO-8859-1, es_US.UTF-8 UTF-8, es_UY ISO-8859-1, es_UY.UTF-8 UTF-8, es_VE ISO-8859-1, es_VE.UTF-8 UTF-8, et_EE ISO-8859-1, et_EE.ISO-8859-15 ISO-8859-15, et_EE.UTF-8 UTF-8, eu_ES ISO-8859-1, eu_ES.UTF-8 UTF-8, eu_ES@euro ISO-8859-15, eu_FR ISO-8859-1, eu_FR.UTF-8 UTF-8, eu_FR@euro ISO-8859-15, fa_IR UTF-8, ff_SN UTF-8, fi_FI ISO-8859-1, fi_FI.UTF-8 UTF-8, fi_FI@euro ISO-8859-15, fil_PH UTF-8, fo_FO ISO-8859-1, fo_FO.UTF-8 UTF-8, fr_BE ISO-8859-1, fr_BE.UTF-8 UTF-8, fr_BE@euro ISO-8859-15, fr_CA ISO-8859-1, fr_CA.UTF-8 UTF-8, fr_CH ISO-8859-1, fr_CH.UTF-8 UTF-8, fr_FR ISO-8859-1, fr_FR.UTF-8 UTF-8, fr_FR@euro ISO-8859-15, fr_LU ISO-8859-1, fr_LU.UTF-8 UTF-8, fr_LU@euro ISO-8859-15, fur_IT UTF-8, fy_DE UTF-8, fy_NL UTF-8, ga_IE ISO-8859-1, ga_IE.UTF-8 UTF-8, ga_IE@euro ISO-8859-15, gd_GB ISO-8859-15, gd_GB.UTF-8 UTF-8, gez_ER UTF-8, gez_ER@abegede UTF-8, gez_ET UTF-8, gez_ET@abegede UTF-8, gl_ES ISO-8859-1, gl_ES.UTF-8 UTF-8, gl_ES@euro ISO-8859-15, gu_IN UTF-8, gv_GB ISO-8859-1, gv_GB.UTF-8 UTF-8, ha_NG UTF-8, hak_TW UTF-8, he_IL ISO-8859-8, he_IL.UTF-8 UTF-8, hi_IN UTF-8, hne_IN UTF-8, hr_HR ISO-8859-2, hr_HR.UTF-8 UTF-8, hsb_DE ISO-8859-2, hsb_DE.UTF-8 UTF-8, ht_HT UTF-8, hu_HU ISO-8859-2, hu_HU.UTF-8 UTF-8, hy_AM UTF-8, hy_AM.ARMSCII-8 ARMSCII-8, ia_FR UTF-8, id_ID ISO-8859-1, id_ID.UTF-8 UTF-8, ig_NG UTF-8, ik_CA UTF-8, is_IS ISO-8859-1, is_IS.UTF-8 UTF-8, it_CH ISO-8859-1, it_CH.UTF-8 UTF-8, it_IT ISO-8859-1, it_IT.UTF-8 UTF-8, it_IT@euro ISO-8859-15, iu_CA UTF-8, iw_IL ISO-8859-8, iw_IL.UTF-8 UTF-8, ja_JP.EUC-JP EUC-JP, ja_JP.UTF-8 UTF-8, ka_GE GEORGIAN-PS, ka_GE.UTF-8 UTF-8, kk_KZ PT154, kk_KZ RK1048, kk_KZ.UTF-8 UTF-8, kl_GL ISO-8859-1, kl_GL.UTF-8 UTF-8, km_KH UTF-8, kn_IN UTF-8, ko_KR.EUC-KR EUC-KR, ko_KR.UTF-8 UTF-8, kok_IN UTF-8, ks_IN UTF-8, ks_IN@devanagari UTF-8, ku_TR ISO-8859-9, ku_TR.UTF-8 UTF-8, kw_GB ISO-8859-1, kw_GB.UTF-8 UTF-8, ky_KG UTF-8, lb_LU UTF-8, lg_UG ISO-8859-10, lg_UG.UTF-8 UTF-8, li_BE UTF-8, li_NL UTF-8, lij_IT UTF-8, lo_LA UTF-8, lt_LT ISO-8859-13, lt_LT.UTF-8 UTF-8, lv_LV ISO-8859-13, lv_LV.UTF-8 UTF-8, lzh_TW UTF-8, mag_IN UTF-8, mai_IN UTF-8, mg_MG ISO-8859-15, mg_MG.UTF-8 UTF-8, mhr_RU UTF-8, mi_NZ ISO-8859-13, mi_NZ.UTF-8 UTF-8, mk_MK ISO-8859-5, mk_MK.UTF-8 UTF-8, ml_IN UTF-8, mn_MN UTF-8, mni_IN UTF-8, mr_IN UTF-8, ms_MY ISO-8859-1, ms_MY.UTF-8 UTF-8, mt_MT ISO-8859-3, mt_MT.UTF-8 UTF-8, my_MM UTF-8, nan_TW UTF-8, nan_TW@latin UTF-8, nb_NO ISO-8859-1, nb_NO.UTF-8 UTF-8, nds_DE UTF-8, nds_NL UTF-8, ne_NP UTF-8, nhn_MX UTF-8, niu_NU UTF-8, niu_NZ UTF-8, nl_AW UTF-8, nl_BE ISO-8859-1, nl_BE.UTF-8 UTF-8, nl_BE@euro ISO-8859-15, nl_NL ISO-8859-1, nl_NL.UTF-8 UTF-8, nl_NL@euro ISO-8859-15, nn_NO ISO-8859-1, nn_NO.UTF-8 UTF-8, nr_ZA UTF-8, nso_ZA UTF-8, oc_FR ISO-8859-1, oc_FR.UTF-8 UTF-8, om_ET UTF-8, om_KE ISO-8859-1, om_KE.UTF-8 UTF-8, or_IN UTF-8, os_RU UTF-8, pa_IN UTF-8, pa_PK UTF-8, pap_AN UTF-8, pap_AW UTF-8, pap_CW UTF-8, pl_PL ISO-8859-2, pl_PL.UTF-8 UTF-8, ps_AF UTF-8, pt_BR ISO-8859-1, pt_BR.UTF-8 UTF-8, pt_PT ISO-8859-1, pt_PT.UTF-8 UTF-8, pt_PT@euro ISO-8859-15, quz_PE UTF-8, ro_RO ISO-8859-2, ro_RO.UTF-8 UTF-8, ru_RU ISO-8859-5, ru_RU.CP1251 CP1251, ru_RU.KOI8-R KOI8-R, ru_RU.UTF-8 UTF-8, ru_UA KOI8-U, ru_UA.UTF-8 UTF-8, rw_RW UTF-8, sa_IN UTF-8, sat_IN UTF-8, sc_IT UTF-8, sd_IN UTF-8, sd_IN@devanagari UTF-8, se_NO UTF-8, shs_CA UTF-8, si_LK UTF-8, sid_ET UTF-8, sk_SK ISO-8859-2, sk_SK.UTF-8 UTF-8, sl_SI ISO-8859-2, sl_SI.UTF-8 UTF-8, so_DJ ISO-8859-1, so_DJ.UTF-8 UTF-8, so_ET UTF-8, so_KE ISO-8859-1, so_KE.UTF-8 UTF-8, so_SO ISO-8859-1, so_SO.UTF-8 UTF-8, sq_AL ISO-8859-1, sq_AL.UTF-8 UTF-8, sq_MK UTF-8, sr_ME UTF-8, sr_RS UTF-8, sr_RS@latin UTF-8, ss_ZA UTF-8, st_ZA ISO-8859-1, st_ZA.UTF-8 UTF-8, sv_FI ISO-8859-1, sv_FI.UTF-8 UTF-8, sv_FI@euro ISO-8859-15, sv_SE ISO-8859-1, sv_SE.ISO-8859-15 ISO-8859-15, sv_SE.UTF-8 UTF-8, sw_KE UTF-8, sw_TZ UTF-8, szl_PL UTF-8, ta_IN UTF-8, ta_LK UTF-8, te_IN UTF-8, tg_TJ KOI8-T, tg_TJ.UTF-8 UTF-8, th_TH TIS-620, th_TH.UTF-8 UTF-8, the_NP UTF-8, ti_ER UTF-8, ti_ET UTF-8, tig_ER UTF-8, tk_TM UTF-8, tl_PH ISO-8859-1, tl_PH.UTF-8 UTF-8, tn_ZA UTF-8, tr_CY ISO-8859-9, tr_CY.UTF-8 UTF-8, tr_TR ISO-8859-9, tr_TR.UTF-8 UTF-8, ts_ZA UTF-8, tt_RU UTF-8, tt_RU@iqtelif UTF-8, ug_CN UTF-8, uk_UA KOI8-U, uk_UA.UTF-8 UTF-8, unm_US UTF-8, ur_IN UTF-8, ur_PK UTF-8, uz_UZ ISO-8859-1, uz_UZ.UTF-8 UTF-8, uz_UZ@cyrillic UTF-8, ve_ZA UTF-8, vi_VN UTF-8, wa_BE ISO-8859-1, wa_BE.UTF-8 UTF-8, wa_BE@euro ISO-8859-15, wae_CH UTF-8, wal_ET UTF-8, wo_SN UTF-8, xh_ZA ISO-8859-1, xh_ZA.UTF-8 UTF-8, yi_US CP1255, yi_US.UTF-8 UTF-8, yo_NG UTF-8, yue_HK UTF-8, zh_CN GB2312, zh_CN.GB18030 GB18030, zh_CN.GBK GBK, zh_CN.UTF-8 UTF-8, zh_HK BIG5-HKSCS, zh_HK.UTF-8 UTF-8, zh_SG GB2312, zh_SG.GBK GBK, zh_SG.UTF-8 UTF-8, zh_TW BIG5, zh_TW.EUC-TW EUC-TW, zh_TW.UTF-8 UTF-8, zu_ZA ISO-8859-1, zu_ZA.UTF-8 UTF-8 -locales locales/locales_to_be_generated multiselect en_GB.UTF-8 UTF-8 +locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8 # Default locale for the system environment: # Choices: None, C.UTF-8, en_GB.UTF-8 -locales locales/default_environment_locale select en_GB.UTF-8 +locales locales/default_environment_locale select en_US.UTF-8 diff --git a/stage1/01-sys-tweaks/files/fstab b/stage1/01-sys-tweaks/files/fstab index f16e3fb..198add3 100644 --- a/stage1/01-sys-tweaks/files/fstab +++ b/stage1/01-sys-tweaks/files/fstab @@ -1,3 +1,6 @@ proc /proc proc defaults 0 0 BOOTDEV /boot vfat defaults 0 2 ROOTDEV / ext4 defaults,noatime 0 1 +tmpfs /tmp tmpfs nosuid,nodev 0 0 +tmpfs /var/log tmpfs nosuid,nodev 0 0 +tmpfs /var/tmp tmpfs nosuid,nodev 0 0 diff --git a/stage2/01-sys-tweaks/00-debconf b/stage2/01-sys-tweaks/00-debconf index 96aa9b0..c51627b 100644 --- a/stage2/01-sys-tweaks/00-debconf +++ b/stage2/01-sys-tweaks/00-debconf @@ -12,10 +12,10 @@ console-setup console-setup/fontface47 select Do not change the boot/k keyboard-configuration keyboard-configuration/altgr select The default for the keyboard layout # Keyboard model: # Choices: A4Tech KB-21, A4Tech KBS-8, A4Tech Wireless Desktop RFKB-23, Acer AirKey V, Acer C300, Acer Ferrari 4000, Acer Laptop, Advance Scorpius KI, Amiga, Apple, Apple Aluminium Keyboard (ANSI), Apple Aluminium Keyboard (ISO), Apple Aluminium Keyboard (JIS), Apple Laptop, Asus Laptop, Atari TT, Azona RF2300 wireless Internet Keyboard, BTC 5090, BTC 5113RF Multimedia, BTC 5126T, BTC 6301URF, BTC 9000, BTC 9000A, BTC 9001AH, BTC 9019U, BTC 9116U Mini Wireless Internet and Gaming, BenQ X-Touch, BenQ X-Touch 730, BenQ X-Touch 800, Brother Internet Keyboard, Cherry B.UNLIMITED, Cherry Blue Line CyBo@rd, Cherry Blue Line CyBo@rd (alternate option), Cherry CyBo@rd USB-Hub, Cherry CyMotion Expert, Cherry CyMotion Master Linux, Cherry CyMotion Master XPress, Chicony Internet Keyboard, Chicony KB-9885, Chicony KU-0108, Chicony KU-0420, Classmate PC, Compaq Easy Access Keyboard, Compaq Internet Keyboard (13 keys), Compaq Internet Keyboard (18 keys), Compaq Internet Keyboard (7 keys), Compaq iPaq Keyboard, Creative Desktop Wireless 7000, DTK2000, Dell, Dell 101-key PC, Dell Laptop/notebook Inspiron 6xxx/8xxx, Dell Laptop/notebook Precision M series, Dell Latitude series laptop, Dell Precision M65, Dell SK-8125, Dell SK-8135, Dell USB Multimedia Keyboard, Dexxa Wireless Desktop Keyboard, Diamond 9801 / 9802 series, Ennyah DKB-1008, Everex STEPnote, FL90, Fujitsu-Siemens Computers AMILO laptop, Generic 101-key PC, Generic 102-key (Intl) PC, Generic 104-key PC, Generic 105-key (Intl) PC, Genius Comfy KB-12e, Genius Comfy KB-16M / Genius MM Keyboard KWD-910, Genius Comfy KB-21e-Scroll, Genius KB-19e NB, Genius KKB-2050HS, Gyration, HTC Dream, Happy Hacking Keyboard, Happy Hacking Keyboard for Mac, Hewlett-Packard Internet Keyboard, Hewlett-Packard Mini 110 Notebook, Hewlett-Packard Omnibook 500 FA, Hewlett-Packard Omnibook 5xx, Hewlett-Packard Omnibook 6000/6100, Hewlett-Packard Omnibook XE3 GC, Hewlett-Packard Omnibook XE3 GF, Hewlett-Packard Omnibook XT1000, Hewlett-Packard Pavilion ZT11xx, Hewlett-Packard Pavilion dv5, Hewlett-Packard SK-250x Multimedia Keyboard, Hewlett-Packard nx9020, Honeywell Euroboard, Htc Dream phone, IBM Rapid Access, IBM Rapid Access II, IBM Space Saver, IBM ThinkPad 560Z/600/600E/A22E, IBM ThinkPad R60/T60/R61/T61, IBM ThinkPad Z60m/Z60t/Z61m/Z61t, Keytronic FlexPro, Kinesis, Laptop/notebook Compaq (eg. Armada) Laptop Keyboard, Laptop/notebook Compaq (eg. Presario) Internet Keyboard, Laptop/notebook eMachines m68xx, Logitech Access Keyboard, Logitech Cordless Desktop, Logitech Cordless Desktop (alternate option), Logitech Cordless Desktop EX110, Logitech Cordless Desktop LX-300, Logitech Cordless Desktop Navigator, Logitech Cordless Desktop Optical, Logitech Cordless Desktop Pro (alternate option 2), Logitech Cordless Desktop iTouch, Logitech Cordless Freedom/Desktop Navigator, Logitech G15 extra keys via G15daemon, Logitech Generic Keyboard, Logitech Internet 350 Keyboard, Logitech Internet Keyboard, Logitech Internet Navigator Keyboard, Logitech Media Elite Keyboard, Logitech Ultra-X Cordless Media Desktop Keyboard, Logitech Ultra-X Keyboard, Logitech diNovo Edge Keyboard, Logitech diNovo Keyboard, Logitech iTouch, Logitech iTouch Cordless Keyboard (model Y-RB6), Logitech iTouch Internet Navigator Keyboard SE, Logitech iTouch Internet Navigator Keyboard SE (USB), MacBook/MacBook Pro, MacBook/MacBook Pro (Intl), Macintosh, Macintosh Old, Memorex MX1998, Memorex MX2500 EZ-Access Keyboard, Memorex MX2750, Microsoft Comfort Curve Keyboard 2000, Microsoft Internet Keyboard, Microsoft Internet Keyboard Pro\, Swedish, Microsoft Natural, Microsoft Natural Keyboard Elite, Microsoft Natural Keyboard Pro / Microsoft Internet Keyboard Pro, Microsoft Natural Keyboard Pro OEM, Microsoft Natural Keyboard Pro USB / Microsoft Internet Keyboard Pro, Microsoft Natural Wireless Ergonomic Keyboard 4000, Microsoft Natural Wireless Ergonomic Keyboard 7000, Microsoft Office Keyboard, Microsoft Wireless Multimedia Keyboard 1.0A, Northgate OmniKey 101, OLPC, Ortek MCK-800 MM/Internet keyboard, PC-98xx Series, Propeller Voyager (KTEZ-1000), QTronix Scorpius 98N+, SILVERCREST Multimedia Wireless Keyboard, SK-1300, SK-2500, SK-6200, SK-7100, SVEN Ergonomic 2500, SVEN Slim 303, Samsung SDM 4500P, Samsung SDM 4510P, Sanwa Supply SKB-KG3, Sun Type 4, Sun Type 5, Sun Type 6 (Japanese layout), Sun Type 6 USB (Japanese layout), Sun Type 6 USB (Unix layout), Sun Type 6/7 USB, Sun Type 6/7 USB (European layout), Sun Type 7 USB, Sun Type 7 USB (European layout), Sun Type 7 USB (Japanese layout) / Japanese 106-key, Sun Type 7 USB (Unix layout), Super Power Multimedia Keyboard, Symplon PaceBook (tablet PC), Targa Visionary 811, Toshiba Satellite S3000, Trust Direct Access Keyboard, Trust Slimline, Trust Wireless Keyboard Classic, TypeMatrix EZ-Reach 2020, TypeMatrix EZ-Reach 2030 PS2, TypeMatrix EZ-Reach 2030 USB, TypeMatrix EZ-Reach 2030 USB (102/105:EU mode), TypeMatrix EZ-Reach 2030 USB (106:JP mode), Unitek KB-1925, ViewSonic KU-306 Internet Keyboard, Winbook Model XP5, Yahoo! Internet Keyboard -keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC +keyboard-configuration keyboard-configuration/model select Generic 104-key PC # Keymap to use: # Choices: American English, Albanian, Arabic, Asturian, Bangladesh, Belarusian, Bengali, Belgian, Bosnian, Brazilian, British English, Bulgarian, Bulgarian (phonetic layout), Burmese, Canadian French, Canadian Multilingual, Catalan, Chinese, Croatian, Czech, Danish, Dutch, Dvorak, Dzongkha, Esperanto, Estonian, Ethiopian, Finnish, French, Georgian, German, Greek, Gujarati, Gurmukhi, Hebrew, Hindi, Hungarian, Icelandic, Irish, Italian, Japanese, Kannada, Kazakh, Khmer, Kirghiz, Korean, Kurdish (F layout), Kurdish (Q layout), Lao, Latin American, Latvian, Lithuanian, Macedonian, Malayalam, Nepali, Northern Sami, Norwegian, Persian, Philippines, Polish, Portuguese, Punjabi, Romanian, Russian, Serbian (Cyrillic), Sindhi, Sinhala, Slovak, Slovenian, Spanish, Swedish, Swiss French, Swiss German, Tajik, Tamil, Telugu, Thai, Tibetan, Turkish (F layout), Turkish (Q layout), Ukrainian, Uyghur, Vietnamese -keyboard-configuration keyboard-configuration/xkb-keymap select gb +keyboard-configuration keyboard-configuration/xkb-keymap select us # Compose key: # Choices: No compose key, Right Alt (AltGr), Right Control, Right Logo key, Menu key, Left Logo key, Caps Lock keyboard-configuration keyboard-configuration/compose select No compose key @@ -23,4 +23,4 @@ keyboard-configuration keyboard-configuration/compose select No compose key keyboard-configuration keyboard-configuration/ctrl_alt_bksp boolean true # Keyboard layout: # Choices: English (UK), English (UK) - English (UK\, Colemak), English (UK) - English (UK\, Dvorak with UK punctuation), English (UK) - English (UK\, Dvorak), English (UK) - English (UK\, Macintosh international), English (UK) - English (UK\, Macintosh), English (UK) - English (UK\, extended WinKeys), English (UK) - English (UK\, international with dead keys), Other -keyboard-configuration keyboard-configuration/variant select English (UK) +keyboard-configuration keyboard-configuration/variant select English (US) - English (US\, international with dead keys) diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index f058ffb..be29212 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -1,25 +1,25 @@ +java-common +ntp +daemontools daemontools-run +busybox-syslogd ssh less fbset sudo psmisc strace ed ncdu crda console-setup keyboard-configuration debconf-utils parted unzip -build-essential manpages-dev python bash-completion gdb pkg-config +python gdbserver pkg-config python-rpi.gpio v4l-utils avahi-daemon lua5.1 luajit hardlink ca-certificates curl -fake-hwclock nfs-common usbutils -libraspberrypi-dev libraspberrypi-doc libfreetype6-dev +fake-hwclock usbutils dosfstools dphys-swapfile raspberrypi-sys-mods -pi-bluetooth apt-listchanges usb-modeswitch apt-transport-https libpam-chksshpwd rpi-update libmtp-runtime -rsync htop -man-db policykit-1 ssh-import-id diff --git a/stage2/01-sys-tweaks/01-run.sh b/stage2/01-sys-tweaks/01-run.sh index 4e9c7d0..1c56345 100755 --- a/stage2/01-sys-tweaks/01-run.sh +++ b/stage2/01-sys-tweaks/01-run.sh @@ -11,11 +11,40 @@ install -m 644 files/console-setup "${ROOTFS_DIR}/etc/default/" install -m 755 files/rc.local "${ROOTFS_DIR}/etc/" +# disable wireless +install -m 644 files/raspi-blacklist.conf "${ROOTFS_DIR}/etc/modprobe.d/" + +install -m 644 files/frc.json "${ROOTFS_DIR}/boot/" + +install -m 755 -o 1000 -g 1000 files/multiCameraServer "${ROOTFS_DIR}/home/pi/" + +cat files/jdk_11.0.1-strip.tar.gz | sh -c "mkdir -p ${ROOTFS_DIR}/usr/lib/jvm && cd ${ROOTFS_DIR}/usr/lib/jvm/ && tar xzf - --transform=s/^jdk/jdk-11.0.1/" +cp files/jdk-11.0.1.jinfo "${ROOTFS_DIR}/usr/lib/jvm/.jdk-11.0.1.jinfo" + +on_chroot << EOF +cd /usr/lib/jvm +grep /usr/lib/jvm .jdk-11.0.1.jinfo | awk '{ print "update-alternatives --install /usr/bin/" \$2 " " \$2 " " \$3 " 2"; }' | bash +update-java-alternatives -s jdk-11.0.1 +EOF + +on_chroot << EOF +rm -rf /var/lib/dhcp/ /var/run /var/spool /var/lock +ln -s /tmp /var/lib/dhcp +ln -s /run /var/run +ln -s /tmp /var/spool +ln -s /tmp /var/lock +sed -i -e 's/d \/var\/spool/#d \/var\/spool/' /usr/lib/tmpfiles/var.conf +sed -i -e 's/\/var\/lib\/ntp/\/var\/tmp/' /etc/ntp.conf +EOF + +cat files/bash.bashrc >> "${ROOTFS_DIR}/etc/bash.bashrc" + +cat files/bash.logout >> "${ROOTFS_DIR}/etc/bash.bash_logout" + on_chroot << EOF systemctl disable hwclock.sh -systemctl disable nfs-common systemctl disable rpcbind -systemctl disable ssh +systemctl enable ssh systemctl enable regenerate_ssh_host_keys EOF @@ -49,4 +78,17 @@ on_chroot << EOF usermod --pass='*' root EOF +install -v -d "${ROOTFS_DIR}/service/camera" + +install -m 755 files/camera_run "${ROOTFS_DIR}/service/camera/run" + +on_chroot << EOF +cd /service/camera && rm -f supervise && ln -s /tmp/camera-supervise supervise +cd /etc/service && rm -f camera && ln -s /service/camera . +EOF + +install -m 755 -o 1000 -g 1000 files/runCamera "${ROOTFS_DIR}/home/pi/" +install -m 755 -o 1000 -g 1000 files/runInteractive "${ROOTFS_DIR}/home/pi/" +install -m 755 -o 1000 -g 1000 files/runService "${ROOTFS_DIR}/home/pi/" + rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key* diff --git a/stage2/01-sys-tweaks/files/bash.bashrc b/stage2/01-sys-tweaks/files/bash.bashrc new file mode 100644 index 0000000..458e9b7 --- /dev/null +++ b/stage2/01-sys-tweaks/files/bash.bashrc @@ -0,0 +1,11 @@ +# set variable identifying the filesystem you work in (used in the prompt below) +set_bash_prompt(){ + fs_mode=$(mount | sed -n -e "s/^\/dev\/.* on \/ .*(\(r[w|o]\).*/\1/p") + PS1='\[\033[01;32m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +} + +alias ro='sudo mount -o remount,ro / ; sudo mount -o remount,ro /boot' +alias rw='sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot' + +# setup fancy prompt +PROMPT_COMMAND=set_bash_prompt diff --git a/stage2/01-sys-tweaks/files/bash.logout b/stage2/01-sys-tweaks/files/bash.logout new file mode 100644 index 0000000..5434d1a --- /dev/null +++ b/stage2/01-sys-tweaks/files/bash.logout @@ -0,0 +1,2 @@ +sudo mount -o remount,ro / +sudo mount -o remount,ro /boot diff --git a/stage2/01-sys-tweaks/files/camera_run b/stage2/01-sys-tweaks/files/camera_run new file mode 100755 index 0000000..fdebe3d --- /dev/null +++ b/stage2/01-sys-tweaks/files/camera_run @@ -0,0 +1,4 @@ +#!/bin/sh +sleep 1 +cd /home/pi +exec ./runCamera diff --git a/stage2/01-sys-tweaks/files/frc.json b/stage2/01-sys-tweaks/files/frc.json new file mode 100644 index 0000000..815793b --- /dev/null +++ b/stage2/01-sys-tweaks/files/frc.json @@ -0,0 +1,13 @@ +{ + "team": 294, + "cameras": [ + { + "name": "rPi Camera 0", + "path": "/dev/video0", + "pixel format": "mjpeg", + "width": 160, + "height": 120, + "fps": 30 + } + ] +} diff --git a/stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo b/stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo new file mode 100644 index 0000000..1eef9de --- /dev/null +++ b/stage2/01-sys-tweaks/files/jdk-11.0.1.jinfo @@ -0,0 +1,36 @@ +name=jdk-11.0.1 +priority=900 +section=main + +hl rmid /usr/lib/jvm/jdk-11.0.1/bin/rmid +hl java /usr/lib/jvm/jdk-11.0.1/bin/java +hl keytool /usr/lib/jvm/jdk-11.0.1/bin/keytool +hl jjs /usr/lib/jvm/jdk-11.0.1/bin/jjs +hl pack200 /usr/lib/jvm/jdk-11.0.1/bin/pack200 +hl rmiregistry /usr/lib/jvm/jdk-11.0.1/bin/rmiregistry +hl unpack200 /usr/lib/jvm/jdk-11.0.1/bin/unpack200 +hl jexec /usr/lib/jvm/jdk-11.0.1/lib/jexec +jdkhl jlink /usr/lib/jvm/jdk-11.0.1/bin/jlink +jdkhl jdeps /usr/lib/jvm/jdk-11.0.1/bin/jdeps +jdkhl jinfo /usr/lib/jvm/jdk-11.0.1/bin/jinfo +jdkhl jstat /usr/lib/jvm/jdk-11.0.1/bin/jstat +jdkhl javadoc /usr/lib/jvm/jdk-11.0.1/bin/javadoc +jdkhl jmod /usr/lib/jvm/jdk-11.0.1/bin/jmod +jdkhl jhsdb /usr/lib/jvm/jdk-11.0.1/bin/jhsdb +jdkhl jps /usr/lib/jvm/jdk-11.0.1/bin/jps +jdkhl jstack /usr/lib/jvm/jdk-11.0.1/bin/jstack +jdkhl jrunscript /usr/lib/jvm/jdk-11.0.1/bin/jrunscript +jdkhl javac /usr/lib/jvm/jdk-11.0.1/bin/javac +jdkhl javap /usr/lib/jvm/jdk-11.0.1/bin/javap +jdkhl jar /usr/lib/jvm/jdk-11.0.1/bin/jar +jdkhl jshell /usr/lib/jvm/jdk-11.0.1/bin/jshell +jdkhl rmic /usr/lib/jvm/jdk-11.0.1/bin/rmic +jdkhl jdeprscan /usr/lib/jvm/jdk-11.0.1/bin/jdeprscan +jdkhl jimage /usr/lib/jvm/jdk-11.0.1/bin/jimage +jdkhl jstatd /usr/lib/jvm/jdk-11.0.1/bin/jstatd +jdkhl jmap /usr/lib/jvm/jdk-11.0.1/bin/jmap +jdkhl jdb /usr/lib/jvm/jdk-11.0.1/bin/jdb +jdkhl serialver /usr/lib/jvm/jdk-11.0.1/bin/serialver +jdkhl jcmd /usr/lib/jvm/jdk-11.0.1/bin/jcmd +jdkhl jarsigner /usr/lib/jvm/jdk-11.0.1/bin/jarsigner +jdk jconsole /usr/lib/jvm/jdk-11.0.1/bin/jconsole diff --git a/stage2/01-sys-tweaks/files/raspi-blacklist.conf b/stage2/01-sys-tweaks/files/raspi-blacklist.conf new file mode 100644 index 0000000..10c91d0 --- /dev/null +++ b/stage2/01-sys-tweaks/files/raspi-blacklist.conf @@ -0,0 +1,6 @@ +#wifi +blacklist brcmfmac +blacklist brcmutil +#bt +blacklist btbcm +blacklist hci_uart diff --git a/stage2/01-sys-tweaks/files/resize2fs_once b/stage2/01-sys-tweaks/files/resize2fs_once index 38a4d47..f479842 100644 --- a/stage2/01-sys-tweaks/files/resize2fs_once +++ b/stage2/01-sys-tweaks/files/resize2fs_once @@ -16,6 +16,7 @@ case "$1" in resize2fs $ROOT_DEV && update-rc.d resize2fs_once remove && rm /etc/init.d/resize2fs_once && + sed -i '/vfat\|ext4/s/defaults/defaults,ro/' /etc/fstab && log_end_msg $? ;; *) diff --git a/stage2/01-sys-tweaks/files/runCamera b/stage2/01-sys-tweaks/files/runCamera new file mode 100755 index 0000000..bf6d308 --- /dev/null +++ b/stage2/01-sys-tweaks/files/runCamera @@ -0,0 +1,3 @@ +#!/bin/sh +sleep 5 +./multiCameraServer diff --git a/stage2/01-sys-tweaks/files/runInteractive b/stage2/01-sys-tweaks/files/runInteractive new file mode 100755 index 0000000..561a412 --- /dev/null +++ b/stage2/01-sys-tweaks/files/runInteractive @@ -0,0 +1,10 @@ +#!/bin/bash +SVCPID=`ps ax | grep runCamera | grep -v grep | cut -c -6 | sed -e 's/ *//g'` +sudo svc -d /service/camera +if [[ ! -z $SVCPID ]]; then + sudo kill $SVCPID + sleep 1 + sudo kill -9 $SVCPID + sleep 1 +fi +exec ./runCamera diff --git a/stage2/01-sys-tweaks/files/runService b/stage2/01-sys-tweaks/files/runService new file mode 100755 index 0000000..3e06b3c --- /dev/null +++ b/stage2/01-sys-tweaks/files/runService @@ -0,0 +1,2 @@ +#!/bin/sh +sudo svc -u /service/camera diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index d21419e..8952c67 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -6,3 +6,13 @@ install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.serv install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant" install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" +on_chroot << EOF +rm -f /etc/resolv.conf +touch /tmp/dhcpcd.resolv.conf +ln -s /tmp/dhcpcd.resolve.conf /etc/resolv.conf +sed -i -e 's/\/run\//\/var\/run\//' /etc/systemd/system/dhcpcd5.control +mv /etc/dhcpcd.conf /boot/ +chown root:root /boot/dhcpcd.conf +ln -s /boot/dhcpcd.conf /etc/dhcpcd.conf +EOF +