{"id":732,"date":"2016-12-09T14:34:31","date_gmt":"2016-12-09T23:34:31","guid":{"rendered":"\/blog\/?p=732"},"modified":"2023-09-21T09:37:50","modified_gmt":"2023-09-21T00:37:50","slug":"beaglebone-black-ubuntu-%ec%b5%9c%ec%a0%81%ed%99%94-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=732","title":{"rendered":"Beaglebone Black \/ Ubuntu \ucd5c\uc801\ud654 \uc2a4\ud06c\ub9bd\ud2b8"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">###########################################################\n#\n# Beaglebone Black \ucd5c\uc801\ud654 \uc2a4\ud06c\ub9bd\ud2b8\n#\n# \uc774 \uc2a4\ud06c\ub9bd\ud2b8\ub294\n# BBB-eMMC-flasher-ubuntu-16.04.1-console-armhf-2017-01-13-2gb.img\n# \uc5d0\uc11c \uc2dc\ud5d8\ub418\uc5c8\uc73c\uba70, \ubc18\ub4dc\uc2dc \uc778\ud130\ub137\uc774 \uac00\ub2a5\ud558\uace0 ubuntu\/temppwd\n# \uacc4\uc815\uc73c\ub85c \uc2e4\ud589\ud574\uc57c \ud55c\ub2e4.\n#\n###########################################################\n\nEXTERNAL_MOUNT_DIR=\/external\n\n###########################################################\n#\n# root \ud328\uc2a4\uc6cc\ub4dc \uc124\uc815\n#\n###########################################################\nsudo echo \"PLEASE, ENTER NEW ROOT PASSWORD.\"\nsudo passwd root\n\n###########################################################\n#\n# lrzsz \uc124\uce58\n#\n###########################################################\nsudo apt-get update -y\nsudo apt-get -y install lrzsz\n\n###########################################################\n#\n# \ub85c\ucf00\uc77c \uc124\uc815\n#\n###########################################################\nsudo locale-gen \"ko_KR.UTF-8\"\n\n###########################################################\n#\n# X11 \ubc0f \ubd88\ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \uc81c\uac70\n#\n###########################################################\nsudo apt-get -y remove --purge lightdm\nsudo apt-get -y remove --purge gnome*\nsudo apt-get -y remove --purge qtcreator*\nsudo apt-get -y remove --purge x11-common\nsudo apt-get -y remove --purge apache2\n\n###########################################################\n#\n# eMMC \ucd08\uae30\ud654 (\ucd08\uae30\ud654 \uc2dc\ud0a4\uba74 \ubd80\ud305\uc2a4\uc704\uce58\ub85c \ubd80\ud305\ud574\uc57c \ud568)\n# \/dev\/mmcblk0 : sdcard\n# \/dev\/mmcblk1 : eMMC\n# sudo dd if=\/dev\/zero of=\/dev\/mmcblk1 bs=512 count=1\n#\n###########################################################\n#dd if=\/dev\/zero of=\/dev\/mmcblk0 bs=512 count=1\n#dd if=\/dev\/zero of=\/dev\/mmcblk1 bs=512 count=1\n\n###########################################################\n#\n# eMMC \uc790\ub3d9 \ub9c8\uc6b4\ud2b8 \ucd94\uac00\n# (Debian\uc774 Standalone \ubc84\uc804\uc778 \uacbd\uc6b0 \uc0ac\uc6a9)\n#\n###########################################################\n#mkdir \/emmc\n#chmod 707 \/emmc\n#echo \"\/dev\/mmcblk1p1 \/emmc auto auto,rw,async,user,nofail 0 2\" >> \/etc\/fstab\n\n###########################################################\n#\n# MicroSD \uc790\ub3d9 \ub9c8\uc6b4\ud2b8 \ucd94\uac00\n# (Debian\uc774 Flasher \ubc84\uc804\uc778 \uacbd\uc6b0 \uc0ac\uc6a9)\n#\n###########################################################\n#mkdir \/sdcard\n#chmod 707 \/sdcard\n#echo \"\/dev\/mmcblk0p1 \/sdcard auto auto,rw,async,user,nofail 0 2\" >> \/etc\/fstab\n\n###########################################################\n#\n# \ud0c0\uc784\uc874 \uc14b\ud305\n#\n###########################################################\nsudo chmod 666 \/etc\/timezone\nsudo echo \"Asia\/Seoul\" > \/etc\/timezone\n#sudo echo \"Etc\/UTC\" > \/etc\/timezone\nsudo chmod 644 \/etc\/timezone\n\n###########################################################\n#\n# \ub124\ud2b8\uc6cc\ud06c \uc14b\ud305 (IP\uc8fc\uc18c \uc218\uc815 \ud6c4 \uc2e4\ud589)\n#\n# \uc708\ub3c4\uc6b0PC\uc758 Linux USB Ethernet \uc778\ud130\ud398\uc774\uc2a4\uc758 IPV4\uc8fc\uc18c\ub294\n# 192.168.7.1\/255.255.255.252\ub85c \ubcc0\uacbd\ud574 \uc8fc\uc5b4\uc57c \ud55c\ub2e4.\n#\n# Wifi\uc640 Ethernet\uc740 \ud55c\uac00\uc9c0\ub9cc \uc0ac\uc6a9\uac00\ub2a5\ud558\uba70,\n# \ub9cc\uc77c Wifi\ub97c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574\uc11c\ub294 \"auto eth0\"\ub97c \uc0ad\uc81c\ud55c\ub2e4.\n#\n###########################################################\nsudo cp \/etc\/network\/interfaces \/etc\/network\/interfaces.old\nsudo chmod 666 \/etc\/network\/interfaces\nsudo echo \"# localhost\" > \/etc\/network\/interfaces\nsudo echo \"auto lo\" >> \/etc\/network\/interfaces\nsudo echo \"iface lo inet loopback\" >> \/etc\/network\/interfaces\nsudo echo \"\" >> \/etc\/network\/interfaces\nsudo echo \"# Ethernet\" >> \/etc\/network\/interfaces\nsudo echo \"auto eth0\" >> \/etc\/network\/interfaces\nsudo echo \"iface eth0 inet static\" >> \/etc\/network\/interfaces\nsudo echo \"address 192.168.0.3\" >> \/etc\/network\/interfaces\nsudo echo \"netmask 255.255.255.0\" >> \/etc\/network\/interfaces\nsudo echo \"gateway 192.168.0.1\" >> \/etc\/network\/interfaces\nsudo echo \"dns-nameservers 168.126.63.1\" >> \/etc\/network\/interfaces\nsudo echo \"\" >> \/etc\/network\/interfaces\nsudo echo \"# USB\" >> \/etc\/network\/interfaces\nsudo echo \"auto usb0\" >> \/etc\/network\/interfaces\nsudo echo \"iface usb0 inet static\" >> \/etc\/network\/interfaces\nsudo echo \"address 192.168.7.2\" >> \/etc\/network\/interfaces\nsudo echo \"netmask 255.255.255.252\" >> \/etc\/network\/interfaces\nsudo echo \"gateway 192.168.7.1\" >> \/etc\/network\/interfaces\nsudo echo \"dns-nameservers 168.126.63.1\" >> \/etc\/network\/interfaces\nsudo echo \"\" >> \/etc\/network\/interfaces\nsudo echo \"# Wifi\" >> \/etc\/network\/interfaces\nsudo echo \"#auto wlan0\" >> \/etc\/network\/interfaces\nsudo echo \"#allow-hotplug wlan0\" >> \/etc\/network\/interfaces\nsudo echo \"#iface wlan0 inet static\" >> \/etc\/network\/interfaces\nsudo echo \"#address 192.168.0.3\" >> \/etc\/network\/interfaces\nsudo echo \"#netmask 255.255.255.0\" >> \/etc\/network\/interfaces\nsudo echo \"#gateway 192.168.0.1\" >> \/etc\/network\/interfaces\nsudo echo \"#dns-nameservers 168.126.63.1\" >> \/etc\/network\/interfaces\nsudo echo \"#wpa-ssid \\\"N702BCM\\\"\" >> \/etc\/network\/interfaces\nsudo echo \"#wpa-psk \\\"0123456789\\\"\" >> \/etc\/network\/interfaces\nsudo chmod 644 \/etc\/network\/interfaces\n\n###########################################################\n#\n# \ub124\ud2b8\uc6cc\ud06c \uc14b\ud305 (DNS)\n#\n###########################################################\nsudo chmod 666 \/etc\/resolv.conf\nsudo echo \"search local\" > \/etc\/resolv.conf\nsudo echo \"nameserver 168.126.63.1\" >> \/etc\/resolv.conf\nsudo chmod 644 \/etc\/resolv.conf\n\n###########################################################\n#\n# USB \ub124\ud2b8\uc6cc\ud06c \uc778\ud130\ud398\uc774\uc2a4 \uc774\ub984\ubcc0\uacbd \uae08\uc9c0\n#\n###########################################################\nsudo mv \/lib\/udev\/rules.d\/73-usb-net-by-mac.rules \/lib\/udev\/rules.d\/73-usb-net-by-mac.rules.no_run\n\n###########################################################\n#\n# \uc804\uccb4 \ud328\ud0a4\uc9c0 \uc5c5\ub370\uc774\ud2b8\n#\n###########################################################\nsudo apt-get update -y\nsudo apt-get upgrade -y\n\n###########################################################\n#\n# \ubd88\ud544\uc694\ud55c \uc11c\ube44\uc2a4 \uc81c\uac70\n#\n# enable \ub418\uc5b4\uc788\ub294 \uc11c\ube44\uc2a4 \ubcf4\uae30\n# ls -1 \/etc\/rc$(runlevel| cut -d\" \" -f2).d\/S* | awk -F'[0-9][0-9]' '{print \"Startup :-> \" $2}'\n#\n###########################################################\nsudo update-rc.d -f acpid remove\nsudo update-rc.d -f alsa-utils remove\nsudo update-rc.d -f apache-htcacheclean remove\nsudo update-rc.d -f apache2 remove\nsudo update-rc.d -f avahi-daemon remove\nsudo update-rc.d -f bootlogs enable\nsudo update-rc.d -f cgmanager remove\nsudo update-rc.d -f cgproxy remove\nsudo update-rc.d -f console-setup remove\nsudo update-rc.d -f dbus remove\nsudo update-rc.d -f dnsmasq remove\nsudo update-rc.d -f haveged remove\nsudo update-rc.d -f hdparm remove\nsudo update-rc.d -f hostapd remove\nsudo update-rc.d -f keyboard-setup remove\nsudo update-rc.d -f killprocs remove\nsudo update-rc.d -f kmod enable\nsudo update-rc.d -f loadcpufreq enable\nsudo update-rc.d -f motd enable\nsudo update-rc.d -f pppd-dns remove\nsudo update-rc.d -f procps enable\nsudo update-rc.d -f rc.local enable\nsudo update-rc.d -f rmnologin enable\nsudo update-rc.d -f rsync remove\nsudo update-rc.d -f screen-cleanup remove\nsudo update-rc.d -f sendsigs remove\nsudo update-rc.d -f sudo enable\nsudo update-rc.d -f ti-ipc-dra7xx enable\nsudo update-rc.d -f udev remove\nsudo update-rc.d -f udhcpd remove\nsudo update-rc.d -f umountfs remove\nsudo update-rc.d -f umountroot remove\nsudo update-rc.d -f urandom remove\n\n# systemctl -t service -a\nsudo systemctl disable alsa-restore.service\nsudo systemctl disable alsa-state.service\nsudo systemctl disable alsa-store.service\nsudo systemctl disable avahi-daemon.service\nsudo systemctl disable bb-wl18xx-bluetooth.service\nsudo systemctl disable bluetooth.service\nsudo systemctl disable bonescript-autorun.service\nsudo systemctl disable bonescript.service\nsudo systemctl disable bonescript.socket\nsudo systemctl disable cloud9.service\nsudo systemctl disable cloud9.socket\nsudo systemctl disable connman.service\nsudo systemctl disable dbus.service\nsudo systemctl disable node-red.service\nsudo systemctl disable systemd-timesyncd\nsudo systemctl disable udhcpd.service\nsudo systemctl enable cpufrequtils.service\nsudo systemctl enable cron.service\nsudo systemctl enable getty@tty1.service\nsudo systemctl enable kmod-static-nodes.service\nsudo systemctl enable loadcpufreq.service\nsudo systemctl enable networking.service\nsudo systemctl enable networking.service\nsudo systemctl enable rc-local.service\nsudo systemctl enable rsyslog.service\nsudo systemctl enable serial-getty@ttyS0.service\nsudo systemctl enable ssh.service\nsudo systemctl enable systemd-fsck@dev-mmcblk1p1.service\nsudo systemctl enable systemd-journal-flush.service\nsudo systemctl enable systemd-journald.service\nsudo systemctl enable systemd-logind.service\nsudo systemctl enable systemd-modules-load.service\nsudo systemctl enable systemd-random-seed.service\nsudo systemctl enable systemd-remount-fs.service\nsudo systemctl enable systemd-sysctl.service\nsudo systemctl enable systemd-timesyncd.service\nsudo systemctl enable systemd-tmpfiles-setup-dev.service\nsudo systemctl enable systemd-tmpfiles-setup.service\nsudo systemctl enable systemd-udev-trigger.service\nsudo systemctl enable systemd-udevd.service\nsudo systemctl enable systemd-update-utmp.service\nsudo systemctl enable systemd-user-sessions.service\nsudo systemctl enable udhcpd.service\nsudo systemctl enable wpa_supplicant.service\n\n###########################################################\n#\n# \ubd88\ud544\uc694\ud55c \ud30c\uc77c \uc815\ub9ac\n#\n###########################################################\nsudo rm -f \/var\/log\/*log\nsudo rm -f \/var\/log\/messages\nsudo rm -rf \/tmp\/*\n\n###########################################################\n#\n# RootFS \ud30c\ud2f0\uc158\uc744 SD Card \uc804\uccb4\uc6a9\ub7c9\uc744 \uc0ac\uc6a9\ud558\ub3c4\ub85d \ud655\uc7a5\n#\n###########################################################\nsudo sync\nsudo \/opt\/scripts\/tools\/grow_partition.sh\n\n###########################################################\n#\n# \ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \uc124\uce58\n# (\uc124\uce58\uac00 \uc548\ub420 \uc218 \uc788\uc73c\ub2c8 \ub9ac\ubd80\ud305 \ud6c4 \ud655\uc778 \uc694\ub9dd)\n#\n###########################################################\nsudo apt-get -y install screen wireless-tools wpasupplicant hostapd\nsudo apt-get -y install gzip bzip2 tar unrar arj p7zip minicom mc ftp lsof\nsudo apt-get -y install iptables bridge-utils isc-dhcp-server\nsudo apt-get -y install ntfs-3g\n\n###########################################################\n#\n# vsftpd \ud328\ud0a4\uc9c0 \uc124\uce58\n#\n###########################################################\nsudo apt-get -y install vsftpd\nsudo echo \"chroot_local_user=YES\" >> \/etc\/vsftpd.conf\nsudo echo \"allow_writeable_chroot=YES\" >> \/etc\/vsftpd.conf\nsudo systemctl disable vsftpd.service\n\n###########################################################\n#\n# nfs \ud328\ud0a4\uc9c0 \uc124\uce58\n#\n###########################################################\n#sudo apt-get -y install nfs-kernel-server\n#sudo apt-get -y install rpcbind\n#sudo update-rc.d nfs-kernel-server remove\n#sudo update-rc.d rpcbind remove\n\n###########################################################\n#\n# samba \ud328\ud0a4\uc9c0 \uc124\uce58\n#\n###########################################################\nsudo apt-get -y install samba\nusermod -d ${EXTERNAL_MOUNT_DIR} ubuntu\n\n###########################################################\n#\n# samba \uc124\uc815\n#\n###########################################################\nsudo sync\nsudo echo \"\"                                 >> \/etc\/samba\/smb.conf\nsudo echo \"[global]\"                         >> \/etc\/samba\/smb.conf\nsudo echo \"netbios name = BBB\"               >> \/etc\/samba\/smb.conf\nsudo echo \"workgroup = WORKGROUP\"            >> \/etc\/samba\/smb.conf\nsudo echo \"hosts allow = 127. 192.168.0.\"    >> \/etc\/samba\/smb.conf\nsudo echo \"\"                                 >> \/etc\/samba\/smb.conf\nsudo echo \"[share]\"                          >> \/etc\/samba\/smb.conf\nsudo echo \"   comment = Beaglebone Black\"    >> \/etc\/samba\/smb.conf\nsudo echo \"   browseble = yes\"               >> \/etc\/samba\/smb.conf\nsudo echo \"   writable = yes\"                >> \/etc\/samba\/smb.conf\nsudo echo \"   share modes = yes\"             >> \/etc\/samba\/smb.conf\nsudo echo \"   valid users = @users\"          >> \/etc\/samba\/smb.conf\nsudo echo \"   create mode = 0660\"            >> \/etc\/samba\/smb.conf\nsudo echo \"   directory mode = 0770\"         >> \/etc\/samba\/smb.conf\nsudo echo \"   guest ok = yes\"                >> \/etc\/samba\/smb.conf\nsudo echo \"   path = ${EXTERNAL_MOUNT_DIR}\"              >> \/etc\/samba\/smb.conf\nsudo echo \"#!\/bin\/sh\" > \/start.samba\nsudo echo \"mkdir -p ${EXTERNAL_MOUNT_DIR}\" >> \/start.samba\nsudo echo \"mount -t ntfs-3g \/dev\/sda1 ${EXTERNAL_MOUNT_DIR}\" >> \/start.samba\nsudo echo \"#systemctl start nmbd.service\" >> \/start.samba\nsudo echo \"systemctl start smbd.service\" >> \/start.samba\nsudo echo \"#!\/bin\/sh\" > \/stop.samba\nsudo echo \"#systemctl stop nmbd.service\" >> \/stop.samba\nsudo echo \"systemctl stop smbd.service\" >> \/stop.samba\nsudo echo \"umount \/dev\/sda1\" >> \/stop.samba\nsudo chmod 755 \/start.samba\nsudo chmod 755 \/stop.samba\nsudo systemctl disable nmbd.service\nsudo systemctl disable smbd.service\nmkdir -p ${EXTERNAL_MOUNT_DIR}\nchmod 755 ${EXTERNAL_MOUNT_DIR}\n\n###########################################################\n#\n# timezone &amp; locale\n#\n###########################################################\napt-get -y install language-pack-ko\nlocale-gen ko_KR.UTF-8\nupdate-locale LANG=ko_KR.UTF-8\ntimedatectl set-timezone \"Asia\/Seoul\"\n\n###########################################################\n#\n# sshd root \uacc4\uc815 \ud65c\uc131\ud654\n#\n###########################################################\nsudo sed -i 's\/#PermitRootLogin yes\/PermitRootLogin yes\/g' \/etc\/ssh\/sshd_config\nsudo sed -i 's\/PermitRootLogin prohibit-password\/PermitRootLogin yes\/g' \/etc\/ssh\/sshd_config\n\n###########################################################\n#\n# \ubd88\ud544\uc694\ud55c \ud30c\uc77c\ub4e4 \uc0ad\uc81c\n#\n###########################################################\nsudo apt-get -y -f autoremove\nsudo apt-get -y autoclean\nsudo apt-get -y clean\nsudo sync<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[13],"tags":[],"class_list":["post-732","post","type-post","status-publish","format-standard","hentry","category-computing_singleboardcomputer"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=732"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/732\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}